开发者

is possible using slideDown and delegate togather in jQuery?

is it possible to combine slideDown method with delegate or live method in jquery to apply slideDown method to later added eleme开发者_StackOverflow社区nets in page?


Absolutely, .slideDown() is just a method, for example:

$("#container").delegate(".toggleButton", "click", function() {
  $(this).next().slideDown();
});

If you want to slide down content as it's added, do that in your AJAX success callback, for example:

$.ajax({ //options...
  success: function(data) {
    $(data).appendTo("#container").hide().slideDown();
  }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜