I need to stop the animation and instantly complete all pending animations.stopdoesn't work:Let's say I have an animation that moves an element that is on 0pxby 100px, and I use stop when it only moves 50px. The result will be item c 50px. The result I want is when I interrupt the animation, even if the item is in 50px, it will instantly go to 100px.How to do it?
stop
0px
100px
50px
$. fn.stop () has the ability to clear the queue and go to the end.
- : $('#foo').stop(true, true);
$('#foo').stop(true, true);
http://forum.jquery.com/topic/stop-true-true-animation-chains-and-callbacks
(function($){ $.fn.extend({ hardStop: function(){ return this.each(function(){ var e = $(this); while (e.queue().length){ e.stop(false, true); } }); } }); })(jQuery);
$("#element").hardStop();
, , :
$("#abc").stop().animate(...
Specify manually the last state, do not be lazy. I'm sure you can do it :)
$('#foo').stop(true, true); $('#foo').css({x, '100px'});
Source: https://habr.com/ru/post/1758947/More articles:Support for multiple languages on iPhone? - iphoneDeny asp: Literal from HTML output - c #How to kill OpenVPN connection using Perl? - linuxHow to check if a database exists with ODBC - sqlgit: how to check the source version of a file in a git repository - gitExtension of the southern introspection in Django - djangoI wrote the exact code in vb and C # and it does not work the same ... the logic is identical ... I hope - c #SQL вы можете использовать инструкцию IF в UDF и как вы это делаете? - sqltwistd in Twisted can not start in window - pythonHow can HRESULT appear in a MIDL file? - c ++All Articles