Forums

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

Home Forums JavaScript jQuery Show/Hide and looping trouble Re: jQuery Show/Hide and looping trouble

#84199
jamygolden
Member

I’m very sure jsfiddle isn’t working correctly for me lol. Anyway, this will add ‘current’ to the #nav li’s

$(document).ready(function(){
$('#nav').children().click(function(){
$(this).addClass('current').siblings().removeClass('current');
$('#list').children().eq($(this).index()).show().siblings().hide();
});
});