Question: In index.html, iframe introduces son.html. How can I click on a certain operation in son.html to block the entire page and pop up the layer to be displayed? Prepare: index.html son.html Ideas: 1: Introduce son.html into iframe in index.html, Copy code The code is as follows:<!-- Right iframe starts--> <div id="resDiv" class="resDiv"> <iframe name="res" class="iframestyle" allowtransparency="true" src="son.html" frameborder="0" scrolling="no"></iframe> </div> <!-- End of right iframe --> 2: Add a shielding layer and a content display layer to the body of index.html Copy code The code is as follows:<!--Pop-up login page layer--> <div id="mapLayer" style="display: none; " > <input type="button" value="Close" onclick="closeMap()" /> </div> <!--Shielding layer, used to transparently shield the entire page--> <div id="mapBgLayer" style="position:absolute; display: none;"></div> 3: How to set the div style and open and close the layer in index.html Copy code The code is as follows:<style type="text/css"> #BgLayer { background: #939393 none repeat scroll 0 0; height:100%; width:100%; left:0; top:0; filter: alpha(opacity=80); /* IE */ -moz-opacity: 0.8; /* Moz + FF */ z-index: 10000; } #Layer { width: 400px; height: 400px; margin: -180px 0 0 -170px; left: 50%; top: 50%; position: absolute; background: #FFF; z-index: 10001; border: 1px solid #1B5BAC; } </style> <script type="text/javascript"> /*Display page*/ function showDiv) { var bg = document.getElementById("BgLayer"); var con = document.getElementById("Layer"); //var w = document.documentElement.clientWidth; //Width of visible area of web page //var h = document.documentElement.clientHeight; //Height of visible area of web page var w = document.body.scrollWidth; //Full text width of the webpage var h = document.body.scrollHeight; //Height of the full text of the web page // alert(w+"-"+h); bg.style.display = ""; bg.style.width = w + "px"; bg.style.height = h + "px"; con.style.display = ""; } /*closure*/ function closeDiv() { var bg = document.getElementById("BgLayer"); var con = document.getElementById("Layer"); bg.style.display = "none"; con.style.display = "none"; } </script> 4: An operation in son.html calls a method on the parent page Copy code The code is as follows:<a href="javascript:void(0)" onclick="parent.window.showDiv()">View</a> |
<<: Creative opening effect achieved by combining CSS 3.0 with video
>>: MySQL 8.0.26 installation and simplified tutorial (the most complete on the Internet)
If you want to become a Linux master, then master...
This article shares the specific code of vue+elem...
Memo: Just experience it. Record: NO.209 This exa...
When connecting to the local database, navicat fo...
Table of contents 1. Introduction 1.1 Babel Trans...
Indexing is similar to building bibliographic ind...
The scroll bar position is retained when scrollin...
1. Design source code Copy code The code is as fol...
The methods and concepts of private filters and g...
Introduction to Vue The current era of big front-...
nginx Nginx (engine x) is a high-performance HTTP...
The floating-point types supported in MySQL are F...
The mobile version of the website should at least...
This article takes the connection error ECONNREFU...
Vue routing this.route.push jump page does not re...