تصف هذه المقالة الأحداث والاستخدامات التي تم إنشاؤها عندما يغلق 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 عرض = 400 ؛ VAR HUPLE = 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 (opitated = 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 (طبقة) ؛ // WINDOW WINDOW var newBox = document.getElementByID ("KF_PJ_DIV") ؛ newbox.style.zindex = "9999" ؛ newbox.style.display = "block" ؛ newbox.style.width = width + "px" ؛ newbox.style.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" ؛ } آخر {newbox.style.margintop = ( - الارتفاع/2) + "px" ؛ } if (width/2> (pagewidth/2)) {newbox.style.marginleft = ( - (pagewidth/2)) + "px" ؛ } آخر {newbox.style.marginleft = ( - العرض/2) + "px" ؛ } إرجاع "أنت لم تعلق على خدمة العملاء بعد ، يرجى النقر فوق" إلغاء "تصنيف!" ؛ } ؛ الدالة 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 عرض = 400 ؛ VAR HUPLE = 200 ؛ var layer = window.top.document.getElementById ("zz_layer") ؛ if (layer! = null) {// mask layer layer.style.width = pageWidth + "px" ؛ layer.style.height = pageheight + "px" ؛ } // Window Window 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" ؛ } آخر {newbox.style.margintop = ( - الارتفاع/2) + "px" ؛ } if (width/2> (pagewidth/2)) {newbox.style.marginleft = ( - (pagewidth/2)) + "px" ؛ } آخر {newbox.style.marginleft = ( - العرض/2) + "px" ؛ }} window.onresize = mydiv_resize ؛لمزيد من المعلومات حول المحتوى المتعلق بـ JavaScript ، يرجى مراجعة موضوعات هذا الموقع: "JavaScript Window Operation and Markets Summary" ، "JSON Operation Skills Summary in JavaScript" ، "JavaScript تبديل المؤثرات الخاصة ومهارات ملخص JavaScript Searchmshs" المهارات المهارات "،" JavaRITH ARIMARING SEMPARY MARTRORS ". خوارزمية ومهارات JavaScript Traversal "و" JavaScript Mathematical Operation Summary of of
آمل أن تكون هذه المقالة مفيدة لبرمجة JavaScript للجميع.