Forums

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

Home Forums JavaScript Tabs – mark active and animation

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41992
    tanotify
    Member

    Demo, what i made is here – http://codepen.io/tanotify/pen/qwsvo
    but i cannot make two things..

    1) Tab which is active have css class “active”
    2) Animation of switching depending of side – left, right

    Help me please – thank you

    #122666
    CarlRosell
    Participant

    first off you need a class with the name .active and then do something with it so you can see if its really active.

    .active{
    color:red;
    }

    then just remove the :first and parent() from your click function. you want to remove every class active and then make the clicked a itself active.

    $(‘nav a’).click(function(){
    $(‘nav a’).removeClass(‘active’);
    $(this).addClass(‘active’);

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