...

View Full Version : Help



grinfeld
06-06-2003, 12:12 PM
I need to add different css files into script. How can I do it in JavaScript?

thanks

WA
06-06-2003, 12:21 PM
Hi:
Just a note to please read our posting guidelines regarding choosing a descriptive subject for your thread: http://www.codingforums.com/postguide.htm

To your question, what's the creteria you wish to use to include a different CSS file, such as whether browser is IE or NS? More info is needed...

Kor
06-06-2003, 12:26 PM
See

http://dhtmlkitchen.com/js/utilities/setStyle/index.jsp

Garadon
06-06-2003, 01:08 PM
not entirely what you mean lol but here is a shot:

<script>
var styleSheets=new Array()
styleSheets[]='cssFile1.css';
styleSheets[]='cssFile2.css';
styleSheets[]='cssFile3.css';

function setStyle(aStyle)
{
if(aStyle>-1 && aStyle<styleSheets.length)
document.getElementById('StyleTag').href=styleSheets[aStyle];
}
</script>
<link rel="STYLESHEET" type="text/css" href="styles1.css" id="StyleTag">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum