swap stylesheet for jquerymobile with a link
I have a variable called $cat(which stands for 'category') in the URL.
Depending on whether it is "a" or "b" I swap the stylesheet using a link:
<?php
if($cat == "a") { ?>
<link rel="stylesheet" href="/css/styleA.css">
<?php }
elseif($cat == "b") { ?>
<link rel="stylesheet" href="/css/styleB.css">
<?php } ?>
styleA.css makes the background-color of the header blue, and styleB.css
makes it red
<div id="header" data-role="header" data-position='fixed'>...</div>
if I click on a link that looks like this:
<a href="index.php?cat=a">Click for red</a>
<a href="index.php?cat=b">Click for blue</a>
the URL actually works (content is incuded depending on $cat) and I do get
the value of $cat but the stylesheet does not seem to have swapped, since
the color doesn't change. But if I reload the page (with the URL given by
the link before) the stylesheets swap and everything works perfectly.
I used the same method for the desktop version of the website I'm working
on and everything works perfectly fine. This issue seems to only appear if
I use jquery mobile.
Does anyone see why this isn't working as it should?
No comments:
Post a Comment