This article example shares the specific code of js to achieve the pop-up effect for your reference. The specific content is as follows Use display to control the display and hiding of pop-up windows <!-- Popup layer --> <div id="popLayer"></div> <!--Black mask--> <div id="popBox"> <div class="close"> X </div> <div> <!-- Contents --> </div> </div> js: //Click the close button var close = document.querySelector(".close") close.onclick = function () { console.log("click") var popBox = document.getElementById("popBox"); var popLayer = document.getElementById("popLayer"); popBox.style.display = "none"; popLayer.style.display = "none"; } //Call when display is neededvar popLayer = document.getElementById("popLayer"); popBox.style.display = "block"; popLayer.style.display = "block"; CSS: /* Popup layer*/ #popLayer { display: none; background-color: #000; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10; opacity: 0.6; } /*Popup layer*/ #popBox { display: none; background-color: #FFFFFF; z-index: 11; width: 220px; height: 300px; position: fixed; top: 0; right: 0; left: 0; bottom: 0; margin: auto; } /*Close button*/ #popBox .close { width: 20px; height: 20px; border-radius: 50%; position: absolute; border: 1px solid #fff; color: #fff; text-align: center; line-height: 20px; right: 8px; top: 8px; z-index: 50; } #popBox .close a { text-decoration: none; color: #2D2C3B; } The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed example of mysql trigger usage
>>: How to modify the time in centos virtual machine
Table of contents 1. Database Engine 1.1 View dat...
This article introduces Nginx from compilation an...
Download the rpm installation package MySQL offic...
1. Create a test table CREATE TABLE `testsign` ( ...
Table of contents 1. unzip command 1.1 Syntax 1.2...
Written in front Nginx is not just a reverse prox...
Superset is a lightweight self-service BI framewo...
Earlier, we used Docker to simply deploy the Spri...
Table of contents 1. Reverse proxy preparation 1....
Cerebro is an evolution of the Elasticsearch Kopf...
I believe that many partners who have just come i...
1. forEach() is similar to map(). It also applies...
Table of contents Preface concept Stabilization d...
In HTML, the Chinese phrase “學好好學” can be express...
When you first learn MySQL, you may not understan...