今晚买四不像:CSS实现可拖拽的漂亮圆角特效弹

作者: 计算机网络技术  发布:2019-09-06

正文实例汇报了JS+CSS完毕可拖拽的上佳圆角特效弹出层的法子。分享给我们供咱们仿照效法。具体如下:

JS+CSS达成可拖拽的精良圆角特效弹出层完整实例,css圆角

本文实例陈述了JS+CSS达成可拖拽的卓越圆角特效弹出层的格局。分享给大家供我们参谋。具体如下:

复制代码 代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
<html xmlns=";
<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)?true:false;
 drag = true;
 xx=isIE?event.x:e.pageX;
 yy=isIE?event.y:e.pageY;
 L = document.getElementById(id).offsetLeft;
 T = document.getElementById(id).offsetTop;
 document.onmousemove = function(e) {
  if (drag) {
   x=isIE?event.x:e.pageX;  if(x<0)x=0;
   y=isIE?event.y:e.pageY;  if(y<0)y=0;
   document.getElementById(id).style.left = L-xx+x;
   document.getElementById(id).style.top  = T-yy+y;
  }
 }
 document.onmouseup=function(){
  drag = false;
 }
}
window.onscroll=function(){
 $("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='' 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程序设计有着帮忙。

本文实例陈诉了JS+CSS实现可拖拽的卓绝圆角特效弹出层的方法。分享给大家供我们...

复制代码 代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
<html xmlns=";
<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)?true:false;
 drag = true;
 xx=isIE?event.x:e.pageX;
 yy=isIE?event.y:e.pageY;
 L = document.getElementById(id).offsetLeft;
 T = document.getElementById(id).offsetTop;
 document.onmousemove = function(e) {
  if (drag) {
   x=isIE?event.x:e.pageX;  if(x<0)x=0;
   y=isIE?event.y:e.pageY;  if(y<0)y=0;
   document.getElementById(id).style.left = L-xx+x;
   document.getElementById(id).style.top  = T-yy+y;
  }
 }
 document.onmouseup=function(){
  drag = false;
 }
}
window.onscroll=function(){
 $("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='//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程序设计具备扶助。

您只怕感兴趣的作品:

  • CSS圆角区块容器生成器
  • CSS完结光滑圆角成效
  • 用js达成CSS圆角生成更新
  • 用js完毕的虚幻CSS圆角效果!!
  • 纯CSS生成抗锯齿圆角的代码
  • css Pepsi-Colas小实例代码
  • 领到自百度有啊的css圆角效果
  • CSS+Jquery达成页面圆角框方法大全
  • jQuery+html5+css3兑现圆角无刷新表单带输入验证作用代码
  • js+css达成的圆角边框TAB选项卡滑动门代码分享(2款)
  • JS+CSS完成自适应选项卡宽度的圆角滑动门效果
  • JS+CSS完毕的经文圆角下拉菜单效果代码
  • CSS 使用Coca Colas才干完毕圆角效果

本文由今晚买四不像发布于计算机网络技术,转载请注明出处:今晚买四不像:CSS实现可拖拽的漂亮圆角特效弹

关键词: