Hi, I am creating a simple nav for a site landing page. It directs the user to one of two sides of the clients business and basically consists of the screen being divided in half as you roll over one side the other fades out.
My code:
HTML
<div id="homeNav">
<a href="retail.html" id="retailNav">Retail</a>
<a href="residential.html" id="residentialNav">Retail</a>
<div id="retailHalf"></div>
<div id="residentialFull"></div>
<div id="retailFull"></div>
JQuery
$('#retailNav').bind({
mouseenter: function() {
$('#residentialFull').fadeOut('slow');
},
mouseleave: function() {
$('#residentialFull').fadeIn('slow');
}
});
$('#residentialNav').bind({
mouseenter: function() {
$('#retailHalf').fadeOut('slow');
},
mouseleave: function() {
$('#retailHalf').fadeIn('slow');
}
});
This works ok my problem is if you move the cursor left and right over the two halves rapidly the animation gets stuck in a loop. I have posted an example here http://jsfiddle.net/4rUAT/
How can I stop this unwanted effect happening? Many thanks in advance.