I learned that function toggle() is deprecated. So what can i use instead toggle for this example:
相关标签:
You can use click and slideToggle method.
click
slideToggle
$("#click").click(function(){ var $block = $("#block"), $this = $(this); $block.slideToggle(function(){ $this.text($block.is(':visible') ? 'hide' : 'show'); }); });