Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

mouseenter with delay jquery

Posted on 2014-03-13
4
580 Views
Last Modified: 2014-03-13
Hi,

I want to use the mouseenter in jquery but only occurs if the mouse stay entered in a element , in my case a td, for more than 3 seconds, my problem is that occurs inmediately after the mouse enters over the td, any idea?
0
Comment
Question by:joyacv2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39927582
Suggest you look at the hoverintent plugin
http://cherne.net/brian/resources/jquery.hoverIntent.html

Saves messing around with timeouts
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39927674
No points for this comment, please, but I'd just like to vote up the use of something like this with a little delay.  It has to be one of the smarter UX designs I've seen in a long time.  It's amazingly annoying when you have to move the mouse over a piece of the navigation and all the flyouts jump all over the screen.  With hoverIntent, it looks like you can give the client a break from all that.  Great suggestion!
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39927708
With your own timer : http://jsfiddle.net/XmsBc/

var _in = function() {
    var dis = this;
    var t = setTimeout(function() {
                $(dis).removeData("timer");
                $(dis).addClass("active")
    }, 3000);
    $(this).data("timer",t);
}

var _ot = function() {
    if($(this).data("timer")) {
        clearInterval($(this).data("timer"));
        $(this).removeData("timer");
    }
    $(this).removeClass("active")
}

$("td").hover(_in,_ot);

Open in new window

0
 
LVL 1

Author Closing Comment

by:joyacv2
ID: 39927733
perfect!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Get a subdirectory name from a url 5 26
How to call a web service and get the results posted in a form in PHP 9 48
Wordpress Security 29 46
Ahax pagination 9 32
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question