Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Hover event madness?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #151012
    justdan
    Participant

    Hey guys,

    Quick question. I’m working with some hover events on page I’m building locally. Things look great, but, I notice on my hovers that every time my cursor passes over the element the event fires and sometimes can look quite sporadic. Example being lets say i move my cursor over the element 6 times quickly and even though I’m no longer hovered on the element it will still fire 6 times. What is a good approach to combat this action? Sorry if this wasn’t explained very well and as always, thank you all for your time and comments :)

    #151016
    whatsoever
    Participant

    I haven’t done anything like this, but just off the top of my mind, here is my solution http://jsfiddle.net/788TC/1/

    If you have any questions feel free to ask :)

    Edit:
    Come to think of it, that wasn’t the greatest solution (not that this is :) ) but you can check this out too:

    http://jsfiddle.net/qAyb7/

    Actually if you play around I am sure you can find a far better solution, please share it if you do :)

    #151038
    TheDoc
    Member

    Might want to look into hoverIntent: http://cherne.net/brian/resources/jquery.hoverIntent.html

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.