Click to See Complete Forum and Search --> : Style Sheet Switching
anoop007
Mar 28th, 2001, 06:59 PM
How to change the style sheet for a page in Javascript?
sail3005
Mar 28th, 2001, 07:04 PM
you could put something like this in the <head>:
if (whatever) {
document.write('<LINK REL="STYLESHEET" TYPE="text/css" HREF="whatever.css">');
}
else {
document.write('<LINK REL="STYLESHEET" TYPE="text/css" HREF="whatever2.css" >');
but I want the user to select a style from a combo box and change it then..
sail3005
Mar 29th, 2001, 12:30 PM
So can you reload the page? Or does it have to be completly on the fly?
on the fly could be better.. but i don't think it could be done..
but your code suggests an idea.. see whether this is good
when user changes style send a cookie with the style name and reload the page... just modifying your script may work.. but i haven't done any work with cookies.. can you help me there?.. or do you have any other ideas?
sail3005
Mar 30th, 2001, 09:06 PM
That does sound like a good idea, and probably the only way to do it. I am not that great with cookies either, but i will help if i can. :D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.