Cet article décrit la couche de masque de cachette et d'effets d'affichage que JS implémente compatible avec Firefox et IE IFRAME ONLOAD Properties. Partagez-le pour votre référence, comme suit:
<% @ Page Language = "Java" import = "java.util. *" Pageencoding = "gb2312"%> <% String path = request.getContextPath (); String basepath = request.getscheme () + ": //" + request.getServername () + ":" + request.getServer () + path + "/"; "- // w3c // dtd html 4.01 transitional // en"> <html> <ead> <base href = "<% = basepath%>"> <itle> </ title> <meta http-equiv = "cache-cache-cache" contenu = "no-cache"> <meta-equiv = "cache-cconstrol" contenu = "no-cache "> http-equiv = "expires" content = "0"> <meta http-equiv = "keywords" contenu = "keyword1, keyword2, keyword3"> <meta http-equiv = "Description" content = "Ceci est ma page"> <! - <lin Type = "Text / CSS"> <! - # couche1 {position: absolu; largeur: 896px; hauteur: 472px; z-index: 1; gauche: 97px; top: 120px;} # couche2 {position: absolu; width: 127px; hauteur: 86px; z-index: 2; gauche: 1159px; {position: absolue; largeur: 200px; hauteur: 115px; z-index: 3; gauche: 404px; top: 160px;} body {background-image: url (lib / images / index111.jpg); margin-left: -10px;}. Input_image {border: 0px solide # 808080; Background-Color: # 006699;} -> </ style> </Ead> <Body Leftmargin = "0" topmargin = "0" marginwidth = "0" marginheight = "0" oncontextmenu = "return false" ondragstart = "return false" onselectstart = "return false" onselect = "document.selection.empty ()") " oncopy = "document.selection.empty ()" onBeForeCopy = "return false" onMouseup = "document.selection.empty ()"> <div id = "Lower3"> <img src = "lib / images / bienvenue33.gif" /> </ div> <div id = "Layer1"> <iframe src = "Earth.jsp" id = "couche1"> </ iframe> </ div> <div id = "couche2"> <entrée type = image src = "lib / images / site Web.jpg" id = "site Web_earth" /> <br> <br> <entrée type = image src = "lib / images / assocator.jpg" id = "select_ass" /> <br> <br> <bry Type = IMAGE = IMAGE = src = "lib / images / yichang.jpg" id = "yichang" /> <br> <br> <input type = image src = "lib / images / lvchang.jpg" id = "gtbike" /> << / div> </ body> </ html> </ script> var secs = 20; var wait = secs * 100; // changer la fonction d'image lorsque la fonction d'image lorsque vous appuyez sur la fonction d'image quand timing () {document.getElementById ("select_ass"). Disabled = true; document.getElementById ("select_ass"). src = "lib / images / 123123.jpg"; // chronométrage Image / * for (i = 1; i <= (wait / 100); i ++) {window.SetTimeout ("DoupDate (" + i + ") 100);} window.setTimeout ("timer ()", attendre);} fonction DoupDate (num) {if (num == (wait / 100)) {document.getElementyid ("select_ass"). Src = "lib / images / associator.jpg"; } else {wut = (wait / 100) -num; document.getElementById ("SELECT_ASS"). src = "lib / images / 123123.jpg"; } * /} // Switch Timer de la fonction d'image d'image d'origine () {document.getElementById ("select_ass"). Disable function () {displayDiv (); btmax.innerhtml = "<iframe src = earth.jsp id = couche1 onload = 'relovediv ()'> </ iframe>";} select_ass.onclick = function () {displayDiv (); timing (); btmax.innerhtml = "<iframe src = 1 id = 1 id = 1 liceer1 onLoad = 'relovediv ()'> </ iframe> "; // js crée un objet iframe / * var NewFrame = window.parent.Document.CreateElement ("iframe"); newFrame.id = "couche1"; newFrame.SetAttribute ("frameborder", "0"); newFrame.SetAttribute ("Scrolli ng "," no "); newFrame.setAttribute (" onload "," relovediv () "); newFrame.setAttribute (" src "," client? name = 1 "); btmax.appendChild (newFrame); * /} yichang.onclick = function () {displayDiv (); btmax.innerhtml = "<iframe src = client? name = 2 id = couche1 onload = 'relovediv ()'> </ iframe>";} gtbike.onclick = function () {btmax.innerhtml = "<iframe src = lib / images / 61111.jpg id = couche1> </ iframe> ";} // Masque Layer affiche var mybg; displayDiv = function () {mybg = document.createElement (" div "); mybg.setAttribute ("id", "mybg"); mybg.innerhtml = "<enter> est en cours de traitement, veuillez patienter <img src = 'lib / images / charging.gif'> </img> </ centr>"; mybg.style.width = "100%"; mybg.style.position = "Absolute"; // Absolute Position Affichage mybg.style.top = "260"; mybg.style.left = "0"; mybg.style.zindex = "100"; // z-axis position mybg.style.opacity = "0,8"; // transparence mybg.style.filter = "alpha (opacity = 80)"; // filtre affiche la transparence document.body.APPENDCHILD (MYBG);} // Masque Raisage du calomnie supprimediv = function () {document.body.removechild (mybg); timer ();} </cript>Pour plus d'informations sur le contenu lié à JavaScript, veuillez consulter les sujets de ce site: "JavaScript Switching Special Effets and Techniques Résumé", "JavaScript Animation Effets et Résumé des techniques", "JavaScript Search Algorithme Skills Rummary", "Javascript Data Structure et Algorithm Skills Scapys Résumé "," Résumé des erreurs et des compétences de débogage JavaScript "et" Résumé de l'utilisation de l'opération mathématique JavaScript "
J'espère que cet article sera utile à la programmation JavaScript de tous.