Dieser Artikel beschreibt die Ereignisse und Verwendungen, die erzeugt werden, wenn JS ein Fenster schließt. Teilen Sie es für Ihre Referenz wie folgt weiter:
/************************************************************ 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 Höhe = 200; var Layer = window.top.document.getElementById ("Zz_Layer"); if (layer! = null) {layer.parentnode.removechild (Layer); } // Mask Layer var layer = window.top.document.createelement ("div"); layer.id = "zz_layer"; Layer.Style.Filter = "Alpha (opacity = 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 (Ebene); // Bewertungsfenster var newbox = document.getElementById ("kf_pj_div"); newbox.style.zindex = "9999"; newbox.style.display = "block"; newbox.style.width = width + "px"; newbox.Style.Height = Höhe + "px"; newbox.style.border = "#565656 4px solide"; newbox.style.background = "#ffffff"; newbox.Style.position = "Absolute"; newbox.style.left = pagewidth/2 + "px"; newbox.style.top = (ClTHELTS/2) + "PX"; if (Höhe/2> (ClTHEight/2)) {newbox.Style.Margintop = ( - (ClTHEight/2)) + "px"; } else {newbox.style.margintop = ( - Höhe/2) + "px"; } if (width/2> (pagewidth/2)) {newbox.style.marginleft = ( - (pagewidth/2)) + "px"; } else {newbox.style.marginleft = ( - width/2) + "px"; } return "Sie haben noch nicht zum Kundendienst kommentiert. Klicken Sie bitte auf 'Cancel' bewertet!"; }; Funktion 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 Höhe = 200; var Layer = window.top.document.getElementById ("Zz_Layer"); if (layer! Layer.Style.Height = PageHeight + "PX"; } // Evaluierungsfenster var newbox = document.getElementById ("kf_pj_div"); newbox.style.left = cltwidth/2 + "px"; newbox.style.top = (ClTHELTS/2) + "PX"; if (Höhe/2> (ClTHEight/2)) {newbox.Style.Margintop = ( - (ClTHEight/2)) + "px"; } else {newbox.style.margintop = ( - Höhe/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 von JavaScript -Traversalalgorithmus und Fähigkeiten "und" JavaScript Mathematical Operation Usage Zusammenfassung von
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.