javascript - jquery slider toggle animation not working -


im trying slider work. know how make one, trying use toggle().. has proven quite difficult, know dont?

http://jsfiddle.net/kr2we/

$("#slider").on("click", function () {     $("#slider").toggle(function () {         $(this).animate({             "height":"100px"         }, 1000);     }, function () {         $(this).animate({             "height":"0"         }, 1000);     }); }); 

$("#slider").toggle(function () {     $(this).animate({         "height":"100px"     }, 1000); }, function () {     $(this).animate({         "height":"20px"     }, 1000); }); 

the correct version of form this

note: function deprecated in jquery 1.8 , removed in 1.9 https://api.jquery.com/toggle-event/. advise not use it.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -