Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Navigation that remembers current page.

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37137
    Jamesv
    Member

    I’m a beginer in the javascript world and I’m trying to make a navigation, like this websites, that has a rollover effect, and shows the current page or sub-page that you are one. So far my javascript looks like this

    $(document).ready(function()
    {
    var currentLocation = window.location.href;
    if (currentLocation = ‘file:///C:/OASIStask/test.htm ‘)
    {
    $(“#dashboard li”).css(“color”, “white”);
    console.log(‘no navigation highlight1’);
    };
    )};
    I’m having trouble with what to use to change the background color of the navigation. I’ve tried background, color, background-color, etc. and have had no success.

    Not sure where to go from here.

    #98982
    Jamesv
    Member

    And I tested this using the “body” and “background”, “white”, which worked fine.

    #98989
    Senff
    Participant

    To change the background color of an element, you can use ‘backgroundColor’ and ‘background-color’. See here for an example: http://jsfiddle.net/senff/6Ebk2/

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.