carlsednaoui / ouibounce

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

vanilla javascript might not be working #141

Closed doncabreraphone closed 5 years ago

doncabreraphone commented 5 years ago

Hello people!

I'm trying to use the vanilla version of the plugin.

Added the modal box, added the code. It fires as it should (console.log prints the script fired OK) but it never "shows" the modal box. It never sets it to block.

My modal box code is fairly simple:

var _ouibounce = ouibounce(document.getElementById('ouibounce-modal'), { aggressive: true, timer: 0, callback: function() { console.log('ouibounce fired!'); _ouibounce.fire(); } });

<div id="ouibounce-modal" style="display: none;">Well hello</div>

doncabreraphone commented 5 years ago

Didn't knew I had to call it from onload.

Disregard my stupidity. Perhaps add that noob issue to the docs?