本文实例讲述了JS+CSS实现可拖拽的漂亮圆角特效弹出层的方法。分享给大家供大家参考。具体如下:
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS+CSS实现的可拖拽的漂亮圆角效果的弹出层</title>
<style>
body{
margin:0px;
padding:0px;
font-size:14px;
}
#t {
position:absolute;
float:left;
left:0px;
top:0px;
}
#a {
float:left;
}
.al {
opacity: 0.80;
filter : progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=80,finishOpacity=100);
}
.al2{
opacity: 0.00;
filter : progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0,finishOpacity=100);
}
U {
DISPLAY: block;
OVERFLOW: hidden;
HEIGHT: 1px
}
U.f1 {
background-color:#5cc;
BACKGROUND: #5cc;
MARGIN: 0px 3px
}
U.f2 {
background-color:#5cc;
BORDER-RIGHT: #5cc 2px solid;
MARGIN: 0px 1px;
BORDER-LEFT: #5cc 2px solid
}
U.f3 {
background-color:#5cc;
BORDER-RIGHT: #5cc 1px solid;
MARGIN: 0px 1px;
BORDER-LEFT: #5cc 1px solid
}
.d_top{
clear:both;
overflow:hidden;
background-color:#5cc;
height:29px;
vertical-align:bottom;
}
.d_top a{
float:right;
margin-top:5px;
margin-right:13px;
padding-top:3px;
width:18px;
color:red;
background-color:#789;
text-decoration:none;
font-weight:bold;
text-align:center;
vertical-align:middle;
}
.d_top span{
float:left;
font-size:13px;
margin-left:15px;
margin-top:8px;
}
.d_body {
BORDER-RIGHT: #5cc 3px solid;
BORDER-LEFT: #5cc 3px solid;
padding:10px;
height:200px;
background-color:#fff;
}
.d_foot{
clear:both;
overflow:hidden;
background-color:#5cc;
height:2px;
}
</style>
<script type="text/javascript">
function $(id){return document.getElementById(id);}
function show(id){
var t = $(id);
t.style.width=document.body.clientWidth;
t.style.height=document.body.clientHeight;
window.onresize=function(){
t.style.width=document.body.clientWidth;
t.style.height=document.body.clientHeight;
}
$(id).style.display="";
}
function cl(id){
$(id).style.display="none";
}
function moveEvent(e,id){
var isIE = (document.all)"back_div").style.width=document.body.scrollWidth;
$("back_div").style.height=document.body.scrollHeight;
}
</script>
</head>
<body>
<div id="a" style="position:absolute; left:300px; top:200px;">
<a href="javascript:" onClick="show('t')">点这里弹出圆角效果的div</a><a href='https://www.jb51.net/' target='_blank'><u>对话框</u></a>! </div>
<div id="t" style="display:none;">
<div style="width:100%;height:100%; z-index:-1; position:absolute; float:left; background-color:#555;overflow:hidden;" class="al" id="back_div">
<iframe style="position:absolute; left:0px; top:0px; left:0px; bottom:0px; float:left; z-index:-1; margin:0px; padding:0px;" frameborder="0" scrolling="no" width="100%" height="2000px;" class="al2" id="ifr"></iframe>
</div>
<DIV style="WIDTH: 500px; position:absolute;float:left;top:25%; left:30%; z-index:999; clear:both; overflow:hidden;" id="t_div">
<iframe style="position:absolute; left:0px; top:0px; left:0px; bottom:0px; float:left; z-index:-1; margin:0px; padding:0px;" frameborder="0" scrolling="no" width="100%" height="2000px;" class="al2" id="ifr"></iframe>
<U class="f1"></U><U class="f2"></U><U class="f3"></U>
<div class="d_top" onMouseDown="moveEvent(event,'t_div')">
<span>欢迎光临</span>
<a href="javascript:" onClick="cl('t')">×</a>
</div>
<DIV class="d_body" >欢迎光临:
</DIV>
<div class="d_foot"></div>
<U class="f3"></U><U class="f2"></U><U class="f1"></U>
</DIV>
</div>
</body>
</html>
希望本文所述对大家的javascript程序设计有所帮助。
更新动态
- 李宗盛《理性与感性 作品音乐会》2CD[低速原抓WAV+CUE][1.8G]
- 群星《华语贺年金曲》K2HD[WAV+CUE][697M]
- 群星《酒廊夜色美》2CD[DTS-WAV]
- 群星《2024好听新歌35》AI调整音效【WAV分轨】
- 神秘园《讲故事的人》2019[FLAC+CUE/整轨]
- 张智霖VS许秋怡.1991-现代爱情故事【永高创意】【WAV+CUE】
- 忧欢派对.1988-忧欢派对【飞碟】【WAV+CUE】
- 群星.2009-他的沧海遗珠精选(金碟铁盒珍藏系列)【SONY】【WAV+CUE】
- 刘德华《经典金曲》[WAV+CUE][833M]
- 邓丽君《千言万语》SACD德国限量版[低速原抓WAV+CUE][1G]
- 王闻VS曼里《不老情歌》经典粤语情歌[低速原抓WAV分轨][1G]
- 英雄联盟faker有多少联赛冠军 faker联赛冠军数量介绍
- 炉石传说酒馆战棋分数等级段位介绍 酒馆战棋分数最新等级划分一览
- 野狗子奇才三姐怎么收集 野狗子奇才三姐收集攻略
- 香港群星《电影歌曲101》6CD[WAV整轨]