บทความนี้อธิบายถึงการซ่อนเลเยอร์หน้ากากและเอฟเฟกต์การแสดงผลที่ JS ใช้เข้ากันได้กับคุณสมบัติ Firefox และ IE IFRAME OnLoad แบ่งปันสำหรับการอ้างอิงของคุณดังนี้:
<%@ page language = "java" import = "java.util.*" pageencoding = "gb2312"%> <%String Path = request.getContextPath (); String basepath = request.getScheme () + "//" + request.getServerName () + ":" "-// w3c // dtd html 4.01 transitional // en"> <html> <head> <base href = "<%= basepath%>"> <title> </title> <meta http-equiv = "pragma" pragma " http-equiv = "หมดอายุ" content = "0"> <meta http-equiv = "คำหลัก" content = "คำหลัก 1, คำหลัก 2, คำหลัก 3"> <meta http-equiv = "คำอธิบาย" เนื้อหา = "นี่คือหน้าของฉัน"> <! type = "text/css"> <!-#layer1 {ตำแหน่ง: สัมบูรณ์; ความกว้าง: 896px; ความสูง: 472px; z-index: 1; ซ้าย: 97px; top: 120px;}#layer2 {ตำแหน่ง: Absolute; ความกว้าง: 127px; ความสูง: 86px; {ตำแหน่ง: Absolute; Width: 200px; ความสูง: 115px; z-index: 3; ซ้าย: 404px; ด้านบน: 160px;} ร่างกาย {พื้นหลัง-ภาพ: url (lib/images/index111.jpg); margin-left: -10px;}. input_image พื้นหลังสี:#006699;}-> </style> </head> <body lightmargin = "0" topmargin = "0" marginWidth = "0" marginheight = "0" onContextMenu = "return false" onDragStart = oncopy = "document.selection.empty ()" onbeforecopy = "return false" onmouseup = "document.selection.empty ()"> <div id = "layer3"> <img src = "lib/images/welid33.gif"/> </div> id = "layer1"> </iframe> </div> <div id = "layer2"> <ประเภทอินพุต = รูปภาพ src = "lib/images/wite.jpg" id = "sween_earth"/> <br> <br> <อินพุตประเภท = ภาพ src = "lib/images/ociator.jpg" src = "lib/images/yichang.jpg" id = "yichang"/> <br> <br> <ประเภทอินพุต = image src = "lib/images/lvchang.jpg" id = "gtbike"/> <</div> </body> </html> Timing () {document.getElementById ("select_ass"). ปิดใช้งาน = true; document.getElementById ("select_ass"). src = "lib/images/123123.jpg"; 100);} window.settimeout ("ตัวจับเวลา ()", รอ);} ฟังก์ชั่น doupdate (num) {ถ้า (num == (รอ/100)) {document.getElementById ("select_ass"). src = "lib/images/ociator.jpg"; } else {wut = (รอ/100) -num; document.getElementById ("select_ass"). src = "lib/images/123123.jpg"; }*/} // สลับฟังก์ชั่นภาพต้นฉบับ () {document.getElementById ("select_ass"). ปิดใช้งาน = false; document.getElementById ("select_ass"). src = "lib/images/ociator.jpg"; function () {displaydiv (); btmax.innerhtml = "<iframe src = earth.jsp id = layer1 onload = 'removediv ()'> </iframe>";} select_ass.onclick = function () {displaydiv (); onload = 'removediv ()'> </iframe> "; // js สร้างวัตถุ iframe/*var newFrame = window.parent.document.createElement ("iframe"); newFrame.id = "layer1"; newframe.setAttribute ("frameBorder", "0"); newFrame.setAttribute ("Scrolli ng "," no "); newframe.setAttribute (" onload "," removediv () "); newframe.setAttribute (" src "," ไคลเอนต์? name = 1 "); btmax.appendchild (newframe); function () {displaydiv (); btmax.innerhtml = "<iframe src = ไคลเอนต์? name = 2 id = layer1 onload = 'removediv ()'> </iframe>";} gtbike.onclick = function () {btmax.innerhtml = " id = layer1> </iframe> ";} // หน้ากากเลเยอร์การแสดงผล var mybg; displaydiv = function () {mybg = document.createElement (" div "); mybg.setAttribute ("id", "mybg"); mybg.innerhtml = "<enter> กำลังดำเนินการอยู่โปรดรอ <img src = 'lib/images/loading.gif'> </img> </enter>"; mybg.style.width = "100%"; mybg.style.position = "สัมบูรณ์"; // ตำแหน่งสัมบูรณ์แสดง mybg.style.top = "260"; mybg.style.left = "0"; mybg.style.zindex = "100"; // z-axis ตำแหน่ง mybg.style.opacity = "0.8"; // ความโปร่งใส mybg.style.filter = "alpha (opacity = 80)"; removediv = function () {document.body.removechild (mybg); timer ();} </script>สำหรับข้อมูลเพิ่มเติมเกี่ยวกับเนื้อหาที่เกี่ยวข้องกับ JavaScript โปรดตรวจสอบหัวข้อของไซต์นี้: "JavaScript Switching เอฟเฟกต์พิเศษและเทคนิคสรุป", "JavaScript Animation พิเศษและเทคนิคสรุปเทคนิคการใช้งาน JavaScript และทักษะการใช้งาน Javascript สรุป "," ข้อผิดพลาดของ JavaScript และการดีบักทักษะสรุป "และ" JavaScript Mathematical Operation Summary สรุป "
ฉันหวังว่าบทความนี้จะเป็นประโยชน์กับการเขียนโปรแกรม JavaScript ของทุกคน