Vinny
Vinny

Reputation: 309

Dropdown delay not working

So I'm working on a drop down menu and I'm having a problem. If you hover on it in a certain way, the dropdown menu goes up and down non-stop. Here is the JS:

$("#solar-slide").hover(function() {
    $("ul", this).slideDown(100);
},
function() {
    $("ul", this).slideUp(100);
    }
);

If you'd like to try it yourself, go to mjevange.mysite.syr.edu/SE

Thanks

Upvotes: 0

Views: 69

Answers (2)

Sammy
Sammy

Reputation: 3099

Try adding stop():

$("#solar-slide").hover(function() {
    $("ul", this).stop(true).slideDown(100);
},
function() {
    $("ul", this).stop(true).slideUp(100);
    }
);

Upvotes: 1

Michael Best
Michael Best

Reputation: 16688

It's because you're moving the menu item on hover. Removing top: 1px; from your .button:hover css should fix it.

Upvotes: 0

Related Questions