Click here to Skip to main content
15,912,312 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello everybody...
i m trying to make a menu in which the pages will open at mouseover event..i have successfully made it, but there is only one issue in it that it keeps repeating the event if the cursor is still on it, which is kinda annoying...so please help me resolve it.

here is the code,

C#
$(document).ready(function() {

    $('div.content').css("display", "none");

    $('div.content').fadeIn(2000);


    $("a").mouseover(function(event){

        linkLocation = this.href;
        $("div.content").fadeOut(1000, redirectPage);

    });

    function redirectPage() {
        window.location = linkLocation;
    }

});
Posted
Updated 23-Jul-12 23:45pm
v2

1 solution

Use this event
JavaScript
$("a").one("mouseenter mouseleave",function(event)


instead of
JavaScript
$("a").mouseover(function(event)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900