Skip to content

Wikia/js-delayed-hover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS delayed hover

JS delayed hover is module that enable fires event when you hover over element and move your mouse slow enough.

##Demo: Live demo

##Usage:

var container = document.getElementById( 'testContainer' );
delayedHover(
    container, // HTML node element to watch
    {
        checkInterval: 100, // How often mouse speed is calculated
        maxActivationDistance: 20, // Breakpoint for activation, onActivate callback will be fired when mouse speed is below this value
        onActivate: function () { // Function to call when mouse speed meets required conditions
            container.classList.add( 'active' );
        },
        onDeactivate: function() { // Function to call when you stop hovering element
            container.classList.remove( 'active' );
        }
    }
);

##Licence MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •