Este artigo descreve os eventos e usos gerados quando o JS fecha uma janela. Compartilhe -o para sua referência, como segue:
/****************** Feche a janela e envie a avaliação ******************/window.onBeforeUnLoad = function () {var pageWidth = Math.max (window.top.document.body.scrollwidth, window.top.document.documentElement.scrollwidthth); var pageHeight = Math.max (window.top.document.body.scrolHeight, window.top.document.documentElement.scrolHeight); var cltheight = math.max (window.top.document.body.clientHeight, window.top.document.documentElement.clientHeight); var largura = 400; altura var = 200; var camada = window.top.document.getElementById ("zz_layer"); if (camada! = null) {layer.parentnode.removechild (camada); } // máscara camada var camada = window.top.document.createElement ("div"); camada.id = "zz_layer"; camada.style.filter = "alpha (opacidade = 38)"; // ie Layer.style.opacity = "0,38"; // ff camada.style.width = pagewidth + "px"; camada.style.Height = PageHeight + "px"; camada.style.Position = "Absolute"; camada.style.top = 0; camada.style.left = 0; camada.style.backgroundColor = "#000"; camada.style.zindex = "9998"; window.top.document.body.appendchild (camada); // Janela de avaliação var newBox = document.getElementById ("kf_pj_div"); newbox.style.zindex = "9999"; newbox.style.display = "bloco"; newbox.style.width = width + "px"; newbox.style.Height = altura + "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 (altura/2> (cltheight/2)) {newbox.style.margintop = ( - (cltheight/2)) + "px"; } else {newbox.style.margintop = ( - altura/2) + "px"; } if (width/2> (PageWidth/2)) {newbox.style.marginleft = ( - (PageWidth/2)) + "px"; } else {newbox.style.marginleft = ( - width/2) + "px"; } Retorne "Você ainda não comentou o atendimento ao cliente, clique em 'Cancelar' Classificação!"; }; 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.scrolHeight, window.top.document.documentElement.scrolHeight); 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 largura = 400; altura var = 200; var camada = window.top.document.getElementById ("zz_layer"); if (camada! = null) {// máscara camada camada.style.width = pagewidth + "px"; camada.style.Height = PageHeight + "px"; } // Janela de avaliação var newBox = document.getElementById ("kf_pj_div"); newbox.style.left = cltwidth/2 + "px"; newBox.style.top = (cltheight/2) + "px"; if (altura/2> (cltheight/2)) {newbox.style.margintop = ( - (cltheight/2)) + "px"; } else {newbox.style.margintop = ( - altura/2) + "px"; } if (width/2> (PageWidth/2)) {newbox.style.marginleft = ( - (PageWidth/2)) + "px"; } else {newbox.style.marginleft = ( - width/2) + "px"; }} window.onResize = mydiv_resize;Para obter mais informações sobre o conteúdo relacionado ao JavaScript, consulte os tópicos deste site: "Javascript Window Operação e Resumo das Habilidades", "Resumo das Habilidades de Operação JSON em JavaScript", "Javascript Switching Special Effects and Skills Summary Of JavaScript Search Algoritm Skills", "Javascript Animation Effects and Skills Summary Of JavaScript Algoritm Skills", "CrikScript Animation Effects and Skills Summary Of JavaScript Errors Crikm e Destates e Destacados de Crieções de Jav. do algoritmo e habilidades de travessia JavaScript "e" Javascript Mathematic Operation Uso Resumo de
Espero que este artigo seja útil para a programação JavaScript de todos.