Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Help

  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Israel
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help

    I need to add different css files into script. How can I do it in JavaScript?

    thanks

  • #2
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    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...
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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">


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •