luisvinicius167 / gliojs

Exit popup easely. Detects if the mouse of a user leaves the viewport borders of your website
http://luisvinicius167.github.io/gliojs/
438 stars 29 forks source link

Detect "top" event several times #9

Open fatihayyildiz opened 7 years ago

fatihayyildiz commented 7 years ago

Hi,

I am working with this project but when mouse leaves from top,callback function fire one time for each page (which is expected). But I am trying to detect every top leave event. For example second time when mouse to page out I want to fire callback function. How do I reach this ?

Thanks

Jalokim commented 7 years ago

Hi. I also needed to reinit the plugin. No feature is available in the current code, but you can modify the plugin js. In glio.js line 20 we have the init: function() if you add before glio.methods = Array.prototype.slice.call(arguments); something like this: glio.statusTop = 'inactive' it will reset the popup everytime you call init.

here is what my fragment looks like: init: function ( ) { glio.statusTop = 'inactive' // return a Array with the methods glio.methods = Array.prototype.slice.call(arguments); And everytime I want to show the popup again I just call glio.init('...yoursettingshere...')