开发者

Jquery slideToggle next element with live()

I have the following snippet, but it doesn't work. Probably 开发者_运维知识库the live() handler is misplaced:

$('.link').next().hide().prev().live('click' ,function () {
$(this).next('.desc_hidden').slideToggle(100);
});

Thanks. To understand this was the original, but as you can see it toggles every element, not just the next:

    $('.link').live('click' , function(){
$('.desc_hidden').slideToggle('100');
});

Update, the working code is here link. Thanks for everyone.


Assuming that starting from the second code snippet, you just want to have each .link to show the div next to it, you can use the following:

$('.link').live('click' , function(){
     $(this).next('.desc_hidden').slideToggle('100');
});

(this migth need some tweaks depending of your dom implementation).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜