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
  • #37137

    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

    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.


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


    To change the background color of an element, you can use ‘backgroundColor’ and ‘background-color’. See here for an example:

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