Navigation problems!

  • Posted in : Responsy
  • henkbatenburg
    Participant

    Hello!
    I am having trouble with the navigation, when I am on the home page, the home button is selected, but when I select another page the home button in the navigation stays selected, it doesnt change!

    ahmetsali
    Keymaster

    Hi , you can highlight current page’s menu link with jquery as we implemented in our live preview, first remove active class from home menu item in layout.dwt, then add one line jquery code in each pages inside head tag, to make active the related menu item, such as add portfolio pages to this code;

    <script>
    $(function() { $('#nav > li').eq(2).addClass('active'); });
    </script>

    inside

    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->

    section. This codes selects two indexed (third actually) menu item and activates it which is portfolio link. You can check source code in the live preview for other pages if you need, these jquery codes are on the all pages in the head section about line:33 .

    mintsrbija
    Participant

    I do this i when i add this now i have active Home and Portofolio tab!? How to turn off Home now?

    ahmetsali
    Keymaster

    Hi, sorry i have just seen your reply, you can use this code;

    <script>
    $(function() { $('#nav > li').removeClass('active').eq(2).addClass('active'); });
    </script>
    
    robjwat
    Participant

    $(function() { $(‘#nav > li’).eq(2).addClass(‘active’) });

    The above code causes a Syntax error. Please advise.

    ahmetsali
    Keymaster

    @robjwat

    Try the code below, and make sure you put this code after jquery script;

    $(function() { $("#nav > li").eq(2).addClass("active"); });
    
    vanhoutte
    Participant

    nvm, i solved it.
    i didn’t see the index number :p

Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘Responsy’ is closed to new topics and replies.