Usage:

npm install trial-js -S <!--include Trial.js, then you ready to go!--> <script src="node_modules/trial-js/trial.min.js"></script> //if you are using webpack, you can load trial-js through script loader require('script!trial-js') //call a function when mouse enter elements' monitoring area Trial(selector).enter( { distance: 100, cord: 'center'}, function(distance, ele, event){ //do something... ) ); //if you are using jQuery or Zepto, Trial extends $.fn automatically $(selector).enter( { distance: 100, cord: 'center'}, function(distance, ele, event){ //do something... ) );