In order to avoid a sort of flickering effect on the screen due to rollover effects on my page, I want to activate a function from mouseOut of a thumbnail only if a mouseOver state on a different thumbnail is not currently happening. How would I do this?
In order to avoid a sort of flickering effect on the screen due to
Share
You can check to see if any your thumbnail elements have an
activeclass that is added when a successfulmouseoutevent fires. If any other thumbnail elements have this class then do nothing, if none are found then run yourmouseoutcode:You can then remove the
active-mouseoutclass when necessary, for instance if it requires an animation then you can remove this class in the callback for that animation.Here is a jsfiddle of the above solution: http://jsfiddle.net/jasper/zg5g7/