codrops / DirectionAwareHoverEffect

How to create a direction-aware hover effect using CSS3 and jQuery. The idea is to slide in an overlay from the direction we are moving with the mouse.
397 stars 115 forks source link

fixed typo and logic #6

Closed afercia closed 10 years ago

afercia commented 10 years ago
  1. Typo: see jQuery documentation: https://api.jquery.com/on/ where events are "One or more space-separated event types" and not comma separated.
  2. Logic: especially for Firefox, there's the need to clear the transition property before the new starting position is applied, otherwise the element will move to its new starting position executing the animation, being too slow to work correctly. The new starting position applied with: $hoverElem.hide().css( styleCSS.from ); must be applied immediately.