animate wont .stop() - annoyingly simple Jquery issue -


i new jquery , trying search field animate in , when click close icon (#search-close) animates out , #search-close button disappears.

animating in works fine when click close button animates out animates in again

i know simple

thanks in advance

<script type="text/javascript">        $j(document).ready(function() {  $j('#search-slide').mousedown(function() { $j('#search-close').fadein(100); $j('#search-slide').animate({'left':-1}); $j('#tbcopy a').fadeout(100);});  $j('#search-close').mousedown(function() { $j('#search-close').stop().hide(); $j('#search-slide').stop().animate({'left':-250}); });});   </script> 

the reason you're getting error, believe, due close button is, since within top div, trigger both click events. reason stop() doesn't work because these have different animation queues since they're distinct elements. try added boolean value outer div checked before animation done on it.


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -