Pasta: fd2453623966cc3d66514a86f57b995f436adeb5 (2015-10-08)

Język: JavaScript
Adres: p43.pl/p,fd2453623966cc3d66514a86f57b995f436adeb5
Ilość linii: 40
Rozmiar: 1.96 kB
Wyświetleń: 456
Ostatnio użyto: 2017-09-13 15:18:21
function addEvent(obj, evt, fn) { console.log("Event") if (obj.addEventListener) { obj.addEventListener(evt, fn, false); } else if (obj.attachEvent) { obj.attachEvent("on" + evt, fn); } } var number_of_seconds = 7; var start = new Date(); function runPopup() { console.log("#1 - ") if (coupon == '') { console.log("jestem w ifie") addEvent(window, "load", function (e) { addEvent(document, "mouseout", function (e) { var gowno = new Date(); var gowno2 = gowno.getTime() - start.getTime(); console.log(gowno, gowno2); if (gowno2 / 1000 > number_of_seconds) { console.log("mouse out"); e = e ? e : window.event; var from = e.relatedTarget || e.toElement; if (!from || from.nodeName == "HTML") { document.getElementById("newsletter_wrapper").style.display = "block"; //alert("left window"); } } }); }); // window.setTimeout(function () {document.getElementById("newsletter_wrapper").style.display = "block";}, 30000); } } runPopup();