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();
}
});
精彩评论