Home > Web Front-end > HTML Tutorial > 基础理解4:弹出层和拖动

基础理解4:弹出层和拖动

WBOY
Release: 2016-06-20 08:42:15
Original
1241 people have browsed it

弹出层在网页开发中经常用到,以前都是百度一下复制粘贴,从来没有仔细看过也没有理解原理.

直到有一天没有网络,,,然后突然就想到了.这么简单为什么会复制粘贴这么久.总结如下:

   

1、有个大的div背景设个透明度opacity:0.5;filter:alpha(opacity=57),来个absolute或者fixed定位,最宽最高,z-index比覆盖的页面内容大。

   

2、做一个内容div也来个绝对定位,z-index更大一点设置一下喜欢的属性耀眼的box-shadow等等

   

3、设置一个层把他俩包起来方便移除添加,点击按钮的时候就把获取一下然后append到body,不需要就remove掉。如下所示:

   

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template