jQuery hoverIntent plugin: prevent hover event execution on tap event

110 Views Asked by At

Is there any way to prevent execution of a hoverIntent event from occurring on a touchscreen's tap event?

With the following code, the testOver function executes when a visitor "taps" the screen of a touchscreen, although they did not actually hover (there is no cursor).

Is there any way to prevent the event from firing on touch screens? Perhaps by adjusting the testSettings, or using some other timing events?

var testOver = function() {     
        console.log('hover has occurred');
    };
var testOut = function() {
        console.log('out');
    };
var testSettings = {
    sensitivity: 6, // default = 6
    interval: 100, // default = 100
    timeout: 1000, // default = 0
    over: testOver,
    out: testOut
};

$(window).hoverIntent(testSettings);
0

There are 0 best solutions below