SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Menu Bar Help.

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Menu Bar Help.

    Wondering if someone can help me with menu bar javascript.?

    I have a menu bar of -> Home, Services, Safety, About Us, Links, Contact Us

    Each one is a .gif. I have two sets, one red and one blue.

    I want the Red one showing given when menu has been selected. The rest should be blue.

    When the index is loaded Home is always selected so that should be red, but if I go to the other items it should be Blue.

    I have just an index. the page content changes using javascript.

    I have an onclick on the img tag but all that does is flip it from blue to red and red to blue.

    If the div id = any of the menu items that one should be red and the rest blue.

    $("#common_contentwrapper").html($("#"+option).html()); this is the line of code used to switch the page text. it is all hidden when the page is loaded.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about css ?
    a:active { background-image:url('red.gif'); }
    a:hover { background-image:url('red.gif'); }
    a:link { background-image:url('blue.gif');}
    a:visited { background-image:url('blue.gif'); }


Bookmarks

Posting Permissions

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