Forums

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

Home Forums JavaScript jQuery set as active next or previous submenu

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #255802
    Energizer7
    Participant

    I’m working with this: https://codepen.io/anon/pen/LLNXZM

    And i need function which active next or previous link after click to div prev or div next.

    I tried something like this but it does not work.

    $('.prev').click(function() {
      $('#links').children().prev().addClass('active');
        var index = $('#links').children().index('#links');
        $('#linksobsah').children().hide(500).eq(index).show(500);               
        $('#links').children().removeClass('active');
        $('#links').addClass('active'); 
    });
    

    How can i do that?

    #255804
    Paulie_D
    Member

    Well to start with there are no links in your Codepen…I’d start then.

    Plus it’s not entirely clear what it is you are trying to do.

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