it's been a while since i've tinkered with my website, so i forgot where i got the javascript stylesheet switcher i'm using. it seems to work, but not completely. when you click either the dandelion or sweets link underneath the stylin' chameleon part, the look of the site changes accordingly. BUT the positions of the columns and stuff do not, they retain their old positions according to the previous CSS. and then when i click disable styles using the Web Developer extension on Firefox, suddenly everything renders correctly.
the way i see it, it somehow retains the positioning attributes from the previous stylesheet, yet the colors and images and stuff change properly. why that happens and how to fix it, i have no idea how. help, CSS gurus out there!
stylesheet switching
Hi inababes,
Here's an artical from a list apart on style switching that might be helpful.
http://www.alistapart.com/articles/n4switch/
If not provide a link and we can have a look at whats wrong.
stylesheet switching
a link, oh yeah a link! i knew i was forgetting something. :? hehe.
that's my site. i probly got the stylesheet switcher from a previous ALA article or something, the one you linked to doesn't look all that familiar.
[edit] i found the ALA article i was referring to. i'm using the styleswitcher.js file from there.
stylesheet switching
Hi inababes,
It's working fine for me in Firefox.
Has anyone else been having trouble?
stylesheet switching
It is? I'm using Firefox, too. Most of it changes, but not the positioning. Like when you click on "sweets", the background is supposed to be all black, but its not. If you have the webdeveloper extension installed, try clicking disable styles, and then you'll see it as it's supposed to be seen.
it doesn't seem to work in IE either. *sigh*
stylesheet switching
Well I really thought you had lost it for a while
Now after disabling styles I can see what your talking about.
I'm not sure whats causing the problem but will look into it.
stylesheet switching
Not sure how much help this will be (havent looked at the ALA code), but the js function I use for style switching is:
function css(cssName) { var i; for ( i = 0; i < document.styleSheets.length; i++ ) { if ( document.styleSheets[i].title == cssName ) { document.styleSheets[i].disabled = false; } else document.styleSheets[i].disabled = true; } }
stylesheet switching
oh my goodness i think i've got it.
i went through that article again s-l-o-w-l-y now, trying to catch what i might have missed. and then it hit me smack in the face, just the headings should have clued me in on what was wrong. persistent and preferred. my stylesheet was being persistent in showing up even when i chose alternate stylesheets, i should have made it just preferred. fixing it was as easy as adding a title attribute to the link to the stylesheet. :mrgreen:
now, i could be wrong, or just overly excited, so i'd appreciate it if you could double check to see if it's not just on my browser that it's working properly.
[edit] damnit, i thought i had it. sometimes it seems to load up *without* any stylesheet whatsover. i tried the <style>@import method of importing the default stylesheet, but it made it persistent again.
*pulls hair out in frustration*
stylesheet switching
just wanted to say that i *hope* i've finally gotten it this time.
i was missing a few #div definitions (even if they were empty anyway) in some of the stylesheets and i renamed the default stylesheet so it wouldn't get confused with one of the options.
i sure hope so. *crosses fingers*