views:

297

answers:

1

Hi Everyone, I have found a number of answers for the same question in a DIFFERENT context. I'm looking to add '.stop' to the following code to prevent animation queue buildup:

 //Top Mailing List Drop down animation
 $(document).ready(function() {

$('#top_mailing_hidden').hide();

 jQuery('#top_mailing')
   .bind("mouseenter",function(){
  $("#top_mailing_hidden").slideDown('slow');
 }).bind("mouseleave",function(){
  $("#top_mailing_hidden").slideUp('slow');
 });

});
+4  A: 

Just need to add it before you start the next animation

$(document).ready(function() {

var top_mailing_hidden = $('#top_mailing_hidden').hide();
$('#top_mailing').bind("mouseenter",function(){
    top_mailing_hidden.stop().slideDown('slow');
}).bind("mouseleave",function(){
    top_mailing_hidden.stop().slideUp('slow');
});

});

You might look in to the hoverintent jQuery plugin though, helps with making things like this not so jerky.

PetersenDidIt
I second the recommendation to use the hoverIntent plugin.
ayaz
I ended up doing something totally different and using the hoverIntent plugin, but this is the answer!
Brian