carlsednaoui / ouibounce

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

disable modal not working #82

Closed stevenmunro closed 9 years ago

stevenmunro commented 9 years ago

modal.disable(); // disable ouibounce, it will not fire on page exit

This doesn't appear to take effect. The modal still fires regardless.

stevenmunro commented 9 years ago

Sorry, I typed too soon. When the aggressive : true is set, modal.disable has no effect. Probably intended to work that way.

carlsednaoui commented 9 years ago

Can you pls share some code or way to reproduce this?

stevenmunro commented 9 years ago

As per your docs

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

  $('body').on('click', function() {
    $('#ouibounce-modal').hide();
  });

  $('#ouibounce-modal .modal-footer').on('click', function() {
    $('#ouibounce-modal').hide();
  });

  $('#ouibounce-modal .modal').on('click', function(e) {
    e.stopPropagation();
  });

  _ouibounce.disable();

_ouibounce.disable(); has no effect if aggressive: true is set.

carlsednaoui commented 9 years ago

I don't think that's correct. Check out this test file: https://github.com/carlsednaoui/ouibounce/blob/master/test/index.html

You can load the page (make sure you're running it from a server), call _ouibounce.disable() leave the window and nothing happens. Refresh the page, leave the window and ouibounce fires as expected.

Closing since I checked this on my end. Happy to re-open if what I described above doesn't work as expected.

maximusprime424 commented 5 years ago

I'm having the same issue. _ouibounce.disable(); is not working for me. Can you please check this again?