В этой статье описываются события и использование, генерируемые, когда JS закрывает окно. Поделитесь этим для вашей ссылки, следующим образом:
/****************** Закройте окно и отправьте оценку ****************/window.onbeforeUnload = function () {var pagewidth = math.max (window.top.document.body.scrollwidth, window.top.document.documentelement.scrollwidth); var pageHeight = math.max (window.top.document.body.scrollheight, window.top.document.documentelement.scrollheight); var cltheight = math.max (window.top.document.body.clientheight, window.top.document.documentelement.clientheight); var width = 400; var height = 200; var Layer = window.top.document.getElementById ("zz_layer"); if (layer! = null) {layer.parentnode.removechild (layer); } // Маска слой var layer = window.top.document.createElement ("div"); layer.id = "zz_layer"; layer.style.filter = "alpha (непрозрачность = 38)"; // ie layer.style.opacity = "0,38"; // ff layer.style.width = pagewidth + "px"; Layer.style.height = pageheight + "px"; Layer.Style.position = "Absolute"; Layer.style.top = 0; Layer.style.left = 0; Layer.style.backgroundcolor = "#000"; Layer.style.zindex = "9998"; window.top.document.body.appendchild (слой); // окно оценки var newbox = document.getElementbyid ("kf_pj_div"); newbox.style.zindex = "9999"; newbox.style.display = "block"; newbox.style.width = width + "px"; newbox.style.height = height + "px"; newbox.style.border = "#565656 4px solid"; newbox.style.background = "#ffffff"; newbox.style.position = "Absolute"; newbox.style.left = pagewidth/2 + "px"; newbox.style.top = (cltheight/2) + "px"; if (height/2> (cltheight/2)) {newbox.style.margintop = ( - (cltheight/2)) + "px"; } else {newbox.style.margintop = ( - высота/2) + "px"; } if (width/2> (pagewidth/2)) {newbox.style.marginleft = ( - (pagewidth/2)) + "px"; } else {newbox.style.marginleft = ( - width/2) + "px"; } вернуть "Вы еще не прокомментировали службу поддержки, пожалуйста, нажмите« Отменить »!»; }; function mydiv_resize () {var pagewidth = math.max (window.top.document.body.scrollwidth, window.top.document.documentelement.scrollwidth); var pageHeight = math.max (window.top.document.body.scrollheight, window.top.document.documentelement.scrollheight); var cltheight = math.max (window.top.document.body.clientheight, window.top.document.documentelement.clientheight); var cltwidth = math.max (window.top.document.body.clientwidth, window.top.document.documentelement.clientwidth); var width = 400; var height = 200; var Layer = window.top.document.getElementById ("zz_layer"); if (layer! = null) {// маска слоя слоя. style.width = pagewidth + "px"; Layer.style.height = pageheight + "px"; } // окно оценки var newbox = document.getElementByid ("kf_pj_div"); newbox.style.left = cltwidth/2 + "px"; newbox.style.top = (cltheight/2) + "px"; if (height/2> (cltheight/2)) {newbox.style.margintop = ( - (cltheight/2)) + "px"; } else {newbox.style.margintop = ( - высота/2) + "px"; } if (width/2> (pagewidth/2)) {newbox.style.marginleft = ( - (pagewidth/2)) + "px"; } else {newbox.style.marginleft = ( - width/2) + "px"; }} window.onresize = mydiv_resize;For more information about JavaScript related content, please check out the topics of this site: "JavaScript Window Operation and Skills Summary", "Json Operation Skills Summary in JavaScript", "JavaScript Switching Special Effects and Skills Summary of JavaScript Search Algorithm Skills", "JavaScript Animation Special Effects and Skills Summary of JavaScript Errors and Debugging Skills", "JavaScript Data Structure and Algorithm Skills Summary об алгоритме и навыках JavaScript
Я надеюсь, что эта статья будет полезна для каждого программирования JavaScript.