JQuery quickly completes the animation that is currently executing

  • 2020-03-29 23:54:00
  • OfStack

When you need to quickly end a jquery animation that is currently executing, such as fadeOut(), you can execute stop(true) on the object that is executing the current animation. methods

Such as:
 
<script type="text/javascript"> 
function deleteMyConsults(consultid,obj){ 
jQuery(obj).parents("li").html("<div class='show_tip' colspan='6' align='left'> Delete successfully! <a href='javascript:;' onclick='iKnow(this);'> I know the </a></div>").fadeOut(5000) ; 
} 
function iKnow(obj){ 
jQuery(obj).parents("li").stop(true).remove() ; 
} 
</script> 

Related articles: