carlsednaoui / ouibounce

Increase your landing page conversion rates.
MIT License
2.31k stars 373 forks source link

Allow timed delay which is cancelled by the mouse re-entering. Fixes #48. #55

Closed colinodell closed 10 years ago

colinodell commented 10 years ago

This feature allows developers to provide a "grace period" where the mouse may leave the body for a short time without immediately triggering the modal - it will only appear if the mouse does not re-enter after delay ms.

This new feature also fixes issue #48. When you mouse into the page from the toolbar, Windows Chrome 35+ seems to trigger these events in quick succession:

mouseenter
mouseleave
mouseenter

That middle mouseleave would normally cause the modal to appear; however, due to the new feature, the subsequent mouseenter will cancel that timer and thus the modal won't appear. (This even works if delay is set to 0)

This fixes issue #48 for me on Windows 7 64-bit Chrome 36.0.1985.103 beta-m.

colinodell commented 10 years ago

I should mention that I wasn't able to build the project due to local configuration issues. I hope you wouldn't mind building it for me, should this be approved.

colinodell commented 10 years ago

@carlsednaoui, what are your thoughts on this feature?

jescalan commented 10 years ago

Is there any use case for this other than a temporary workaround for #48?

colinodell commented 10 years ago

One possible use case is making the modal feel less intrusive than an instant popup. A small delay (150-400ms perhaps) still makes the message seem important but not so urgent/in-your-face.

It also allows you to "fuzz" the actual trigger, making it feel less like a mouseleave event, and more like the site actually knows you're not interested.

Regarding #48, the only other solution I can think of is monitoring mouse movements, which is certainly doable (but slightly more complex to implement).

soundswaste commented 10 years ago

I am facing the exact same problem in chrome (36.0.1985.125 m) You guys were able to find any fix?

jhard commented 10 years ago

This fixes the issue for me. I was able to reproduce the issue on Chromium 34.0.1847.116 on Lubuntu and multiple Chrome-Versions on Windows 7. Small timeout values (0-30ms) didn't seem to work, 150ms works just fine and doesn't mess with the functionality imho.

Maybe this could get a default value if browser == chrome?