Jquery.hover and .delay

I want to prevent accidental activation of tooltips on hover using .delay and .queue.

This works, except that I do not know how to stop the execution of the queue at the mouse output (leave the area)

$('.has_tooltip').hover( function(){ $(this).toggleClass('highlight').delay(400).queue(function(next){ $(this).children('.tooltip').show(); next(); }); }, function(){ $(this).toggleClass('highlight').children('.tooltip').fadeOut(200) } ); 
+4
source share
1 answer
+2
source

Source: https://habr.com/ru/post/1335207/


All Articles