I have a simple script with a button contained in a DIV with an ID of label. When hovered another div with an id of content is revealed. Both DIV's are contained into a DIV with an id of basket-top. The hover call is attached to this div. Here is the HTML:
<div id="basket-top">
<div id="content"><br />
<br />
content here<br />
<br />
</div>
<div id="label">label here</div>
</div><!-- /basket-top -->
Here is the JS:
$("#basket-top").hover( function () {
$("#basket-top #content").slideDown(500);
}, function () {
$("#basket-top #content").slideUp(500);
});
This is working fine until the user goes in and out quickly which calls the function over and over again and the the layer slides up and down several times. Is there a way to block the function from being called if the previous action is not completed?