javascript_howto thread: SV: Re: SV: Changing CSS files thru Javascripts !!! Help Urgently
Sure thing! :-)
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: Gautam Khanna [mailto:gautamkhanna27@y...]
Skickat: den 5 december 2002 13:40
Till: JavaScript HowTo
=C4mne: [javascript_howto] Re: SV: Changing CSS files thru Javascripts
!!!
Help Urgently
Violla,
it worked
Thanks a lot Robert !!!!!
Gaurav
Robert Nyman <robert.nyman@c...> wrote:There are two ways to do
this:
1. The DOM way (IE5+, Netscape 6+):
Give the
tag an ID, as in:
document.getElementById("myStyle").setAttribute("href",
"mySecondStyle.css");
/* Alternatives might be:
document.getElementById("myStyle").setAttribute("href",
"mySecondStyle.css", true);
document.getElementById("myStyle").href =3D "mySecondStyle.css";
=09
*/
2. Through document write:
if(some_condition_for_style_one){
document.write('
rel=3D"stylesheet">');
}
else{
document.write('
rel=3D"stylesheet">');
}
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: Gautam Khanna [mailto:gautamkhanna27@y...]
Skickat: den 5 december 2002 13:11
Till: JavaScript HowTo
=C4mne: [javascript_howto] Changing CSS files thru Javascripts !!! Help
Urgently
Hi ,
Can u help me ...
i want to Replace the CSS files dynamically at run time ..
using Javascripts {if its possible}
is this possible .,...
assume i have 2 css files with same class names but diff attributes
depending upon the requirement i should be able 2 switch over between
this 2 files ...without a server trip...
i m aware of switching within the style tags but if u using files
externally
then how u need to start this..
in simple words i want to simulate the Skins ...like winamp..for eg..
any help wd be appreciated
Rgds
Gaurav
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now