0
我试图设置一个模式窗口,其中鼠标存在的窗口或点击链接上的页面。无法触发ouibounce.js模式点击
射击退出是确定使用Ouibounce: http://carlsednaoui.github.io/ouibounce/
在Ouibounce API文档建议我也应该能够通过点击来触发模式。
我已经改变了链接在上面的例子中,给它#modal_button的ID,但我不能让它火窗口:
// if you want to use the 'fire' or 'disable' fn,
// you need to save OuiBounce to an object
var _ouibounce = ouibounce(document.getElementById('ouibounce-modal'), {
aggressive: true,
timer: 0,
callback: function() { console.log('ouibounce fired!'); }
});
$('#modal_button').on('click', function() {
$('#ouibounce-modal').fire();
});
$('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();
});
我在这里设立一个的jsfiddle它做同样的事情。 http://jsfiddle.net/fr7k3s6f/
(出于某种原因对机体事件“隐藏”在的jsfiddle不工作)