Over at I have a page on which the user can change the stylesheet to be a dark style or light style.
On that page, as you can see, are two Google AdSense units but, since Google does not allow customisation of the ad units with CSS, I have to create two seperate ad units. One for the dark layout and one the light layout. Therefore, I need to create a javascript function that essentially says if(style=main-default.css) then show this ad else show the dark ad.
Is there a cleancut JS function that does that (check which style sheet is in use)?
My two stylesheets are being declared as:
<style type="text/css" media="all">@import url(css/main-changes.css);</style>
<style type="text/css" media="screen, projection">@import url(css/main-default.css);</style>
Am using IOTBS: Look Who's Switching Too to switch style sheets. I imagine I could insert a variable and detect that but I don't know the code well enough![Frown :( :(](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
On that page, as you can see, are two Google AdSense units but, since Google does not allow customisation of the ad units with CSS, I have to create two seperate ad units. One for the dark layout and one the light layout. Therefore, I need to create a javascript function that essentially says if(style=main-default.css) then show this ad else show the dark ad.
Is there a cleancut JS function that does that (check which style sheet is in use)?
My two stylesheets are being declared as:
<style type="text/css" media="all">@import url(css/main-changes.css);</style>
<style type="text/css" media="screen, projection">@import url(css/main-default.css);</style>
Am using IOTBS: Look Who's Switching Too to switch style sheets. I imagine I could insert a variable and detect that but I don't know the code well enough