Return to Snippet

Revision: 65509
at December 10, 2013 02:37 by jbernus

Initial Code
var isTouchSupported = 'ontouchstart' in window;
var startEvent = isTouchSupported ? 'touchstart' : 'mouseenter';
var endEvent = isTouchSupported ? 'touchend' : 'mouseleave';



Initial URL

Initial Description
Hover events can be irrelevant on mobile devices relying on touch events.
This script switches the classical desktop hover events to touch events.

Inspired by:

Initial Title
Switch hover/touch events for Desktop/mobile devices

Initial Tags

Initial Language