Home  >  Article  >  Web Front-end  >  The specific method of making a simple pop-up layer DIV in the center of the page with JS and displaying the mask in the middle_javascript skills

The specific method of making a simple pop-up layer DIV in the center of the page with JS and displaying the mask in the middle_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:26:191396browse

I have just used it for two days to practice, and I encountered more problems than I imagined, such as:
IE6 background transparency, IE6 center display, and understanding of js objects
openID = display button, conID = need to be displayed div, closeID = close button
Solved:
1. The select element under ie6 can be blocked, but the div has no transparency under ie6
2. The pop-up div can always be displayed in the middle of the browser screen
Problems:
1. Currently does not support .class and only supports #id
2. The div that needs to be displayed needs to set the css by itself
3. Under ie6, the css needs to be set
For example, div {_position: absolute ;_top: expression(documentElement.scrollTop 340 "px"); }
The background div under 4.ie6 has no transparency. The results I searched online cannot solve it. If you have a solution, please leave me a message

Copy code The code is as follows:




Js制作简单弹出层DIV在页面居中 中间显示 遮罩 方法



点击弹出div

sdfdsf


点击弹出div

sdfdsf






Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn