jquery slideToggle call once
问题 That just could be very simple, but it's about 2AM and getting quite sleepy :) I have short script which "slideToggle" div from being non-displayed. $('#cmnt_add').click(function () { $('.dark_div_add').slideToggle(1100); }); Is there a chance to make it workout once, so if non-displayed DIV is opened, clicking same link won't do a thing? Thank you in advance! 回答1: Use .one() : $('#cmnt_add').one("click", function () { $('.dark_div_add').slideToggle(1100); }); From jQuery's documentation: