jquery addClass to trigger -
i have set of trigger divs on click animate nearest div named .animatepanel
.
i have following jquery want add class click trigger (.paneltab
) when animated panel shown class being applied animated panel.
$('.paneltab').click(function() { var panel = $(this).next() $('.animatedpanel').removeclass('active'); $('.animatedpanel').not(panel).slideup(); panel.addclass('active').slidetoggle({ direction: "up" }, 100); });
$('.paneltab').click(function() { $(this).addclass('someclass'); var panel = $(this).next() $('.animatedpanel').removeclass('active'); $('.animatedpanel').not(panel).slideup(); panel.addclass('active').slidetoggle({ direction: "up" }, 100); });
it sounds want apply addclass clicked paneltab. can use $(this)
within listener access clicked paneltab.
were looking more complex?
like perhaps removing "someclass" paneltab class before adding clicked one?
within listener... $('.paneltab').removeclass("someclass"); $(this).addclass("someclass"); ..
Comments
Post a Comment