I would like to know how I can make this script work once, because I can not do it:
// intenção de sair
function addEvent(obj, evt, fn) {
if (obj.addEventListener) {
obj.addEventListener(evt, fn, false);
}
else if (obj.attachEvent) {
obj.attachEvent("on" + evt, fn);
}
}
// gatilho
addEvent(document, 'mouseout', function(evt) {
if (evt.toElement == null && evt.relatedTarget == null ) {
$('#lightbox_overlay').slideDown();
};
});
// fechando o popup
$('#lightbox_overlay, #close').on('click', function(event) {
$('.lightbox').slideUp();
});