Noob question - help

Discussion in 'JavaScript' started by jlam, Aug 18, 2009.

  1. #1
    Hi,

    I have a link:

    <a class="style_switcher" id="style_icon-1" href="#">Red</a>

    It is some kind of CSS style switcher. When press the "Red" it switch web theme from Blue (default) to Red.

    I wish to trigger "Red" automatically - make an JavaScript which will start in Joomla component when it is load - so the user will not press "Red" but it will push it automatically, something like:

    <script type="text/javascript">
    changeStyle('style1');
    </script>

    The script starts, but I've got web page w/o any style.

    I'm new in JavaScript, so I'm stuck and any help will we very helpful.

    Thank you in advance
     
    jlam, Aug 18, 2009 IP
  2. Mastermaniac

    Mastermaniac Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can so by this..

    
    <script type="text/javascript">
    document.onLoad= // Your function here, to change the style!
    </script>
    
    Code (markup):
    Quiet simple, eh?
     
    Mastermaniac, Aug 18, 2009 IP