Cet article décrit les événements et les usages générés lorsque JS ferme une fenêtre. Partagez-le pour votre référence, comme suit:
/ *************. 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 Largeur = 400; hauteur var = 200; var couche = window.top.document.getElementById ("zz_layer"); if (couche! = null) {couche.parentNode.RemoveChild (couche); } // Masky couche var couche = window.top.Document.CreateElement ("div"); couche.id = "zz_layer"; couche.style.filter = "alpha (opacity = 38)"; // ie couche.style.opacity = "0,38"; // ff couche.style.width = pagewidth + "px"; couche.style.height = pageHeight + "px"; couche.style.position = "Absolute"; couche.style.top = 0; couche.style.left = 0; couche.style.backgroundColor = "# 000"; couche.style.zindex = "9998"; window.top.document.body.appendChild (couche); // Fenêtre d'évaluation var newbox = document.getElementById ("kf_pj_div"); newbox.style.zindex = "9999"; newbox.style.display = "bloc"; newbox.style.width = width + "px"; newbox.style.height = height + "px"; newbox.style.border = "# 565656 4px solide"; newbox.style.background = "#ffffff"; newbox.style.position = "absolu"; 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 = (- height / 2) + "px"; } if (width / 2> (pagewidth / 2)) {newbox.style.marginleft = (- (pagewidth / 2)) + "px"; } else {newbox.style.marginleft = (- width / 2) + "px"; } Renvoie "Vous n'avez pas encore commenté le service client, veuillez cliquer sur" Annuler "la note!"; }; fonction 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 Largeur = 400; hauteur var = 200; var couche = window.top.document.getElementById ("zz_layer"); if (couche! = null) {// masque couche couche.style.width = pagewidth + "px"; couche.style.height = pageHeight + "px"; } // Window d'évaluation 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 = (- height / 2) + "px"; } if (width / 2> (pagewidth / 2)) {newbox.style.marginleft = (- (pagewidth / 2)) + "px"; } else {newbox.style.marginleft = (- width / 2) + "px"; }} window.onresize = mydiv_resize;Pour plus d'informations sur le contenu lié à JavaScript, veuillez consulter les sujets de ce site: "JavaScript Window Floper and Skills Résumé", "JSON Operation Skills Summary in JavaScript", "JavaScript Sweeting Effets et Résumé des compétences de la recherche JavaScript ALGORITHM", "Javascript Animation Effets spéciaux et sommaire des compétences en javascript et sommaire JavaScript. de l'algorithme de traverse JavaScript et des compétences "et" JavaScript Mathematical Operation Use Résumé de
J'espère que cet article sera utile à la programmation JavaScript de tous.