Click to See Complete Forum and Search --> : Adjust Text Size
Dysan
01-01-2008, 09:07 AM
Using JavaScript, is it possible to load different CSS files, upon different images being clicked?
Altogether, there will be 4 different text size settings, can the user can select, depending on how big the text needs to be, in order for the user to see correctly.
Upon each image being clicked, how do I load a different style sheet (CSS File)?
sneakyimp
01-08-2008, 01:07 AM
I might be wrong, but I don't think it's possible to alter the entire style sheet using Javascript.
It would be possible to write a pretty short Javascript function that could alter the class applied to every element in your page, however. Not sure if that helps any.
If you want to change the entire style sheet, you'll probably need to use server-side scripting to load a different style sheet.
Weedpacket
01-08-2008, 05:15 AM
Me, I just hold down <ctrl> and roll the mousewheel.
Or hold down <ctrl> and hit '+' or '-'.
Or select "Text Size"->"Increase"/"Decrease" from the "View" menu.
Or...
And I'm not limited to what the page designer thought would be best for me.
Search Google for "Alternate Stylesheets" and throw in "JavaScript" as a search term while you're at it.
If you do do it clientside using Javascript, don't forget to save their choice in a cookie and use it if it's present. Otherwise they'll have to reset the size on every page view.
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.