How can i remove the animate method from an element in jQuery? -
i using "animate" method on nav element. once nav has been opened , icon clicked, animate method triggered change style of nav. when close nav, animation removed , return it's default style used in style sheet. instead, of style animate's css parameter not being cleared. how fix this?
$(".toggle").click(function(event) { event.preventdefault(); $("nav").fadetoggle("medium"); }); $('.fa-heart-o').on("click", function(){ //$('nav').addclass('animate'); $('nav').animate({height:100,bottom:0}, 1000).addclass('animate'); $('ul').addclass('clearfix'); }); $(".times").click(function(){ $('nav').removeclass('animate').hide(); });
there may lingering style changes object. inspect element see. if so, can change them default value (or 1 want them be) css('css-property', [default or desired value]);
alternatively, if don't want of lingering style="" effects, can remove whole thing removeprop('style');
Comments
Post a Comment