Google
      
发新话题
打印

用层模拟可移动的小窗口

用层模拟可移动的小窗口

复制内容到剪贴板
代码:
<html>
<head>
<title>_xWin</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="Description" CONTENT="http://www.xuemu.net">
<style type='text/css'>
<!--
body{font-size:12px;}
a:visited{text-decoration:none;color:slategray;}
a:hover{text-decoration:underline;color:slategray;}
a:link{text-decoration:none;color:slategray;}
-->
</style>
<script language=JScript>
<!--
//可以打包为js文件;
var x0=0,y0=0,x1=0,y1=0;
var offx=6,offy=6;
var moveable=false;
var hover='orange',normal='#336699';//color;
var index=10000;//z-index;
//开始拖动;
function startDrag(obj)
{
if(event.button==1)
{
//锁定标题栏;
obj.setCapture();
//定义对象;
var win = obj.parentNode;
var sha = win.nextSibling;
//记录鼠标和层位置;
x0 = event.clientX;
y0 = event.clientY;
x1 = parseInt(win.style.left);
y1 = parseInt(win.style.top);
//记录颜色;
normal = obj.style.backgroundColor;
//改变风格;
obj.style.backgroundColor = hover;
win.style.borderColor = hover;
obj.nextSibling.style.color = hover;
sha.style.left = x1 + offx;
sha.style.top = y1 + offy;
moveable = true;
}
}
//拖动;
function drag(obj)
{
if(moveable)
{
var win = obj.parentNode;
var sha = win.nextSibling;
win.style.left = x1 + event.clientX - x0;
win.style.top = y1 + event.clientY - y0;
sha.style.left = parseInt(win.style.left) + offx;
sha.style.top = parseInt(win.style.top) + offy;
}
}
//停止拖动;
function stopDrag(obj)
{
if(moveable)
{
var win = obj.parentNode;
var sha = win.nextSibling;
var msg = obj.nextSibling;
win.style.borderColor = normal;
obj.style.backgroundColor = normal;
msg.style.color = normal;
sha.style.left = obj.parentNode.style.left;
sha.style.top = obj.parentNode.style.top;
obj.releaseCapture();
moveable = false;
}
}
//获得焦点;
function getFocus(obj)
{
if(obj.style.zIndex!=index)
{
index = index + 2;
var idx = index;
obj.style.zIndex=idx;
obj.nextSibling.style.zIndex=idx-1;
}
}
//最小化;
function min(obj)
{
var win = obj.parentNode.parentNode;
var sha = win.nextSibling;
var tit = obj.parentNode;
var msg = tit.nextSibling;
var flg = msg.style.display=="none";
if(flg)
{
win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2;
sha.style.height = win.style.height;
msg.style.display = "block";
obj.innerHTML = "0";
}
else
{
win.style.height = parseInt(tit.style.height) + 2*2;
sha.style.height = win.style.height;
obj.innerHTML = "2";
msg.style.display = "none";
}
}
//创建一个对象;
function xWin(id,w,h,l,t,tit,msg)
{
index = index+2;
this.id = id;
this.width = w;
this.height = h;
this.left = l;
this.top = t;
this.zIndex = index;
this.title = tit;
this.message = msg;
this.obj = null;
this.bulid = bulid;
this.bulid();
}
//初始化;
function bulid()
{
var str = ""
+ "<div id=xMsg" + this.id + " "
+ "style='"
+ "z-index:" + this.zIndex + ";"
+ "width:" + this.width + ";"
+ "height:" + this.height + ";"
+ "left:" + this.left + ";"
+ "top:" + this.top + ";"
+ "background-color:" + normal + ";"
+ "color:" + normal + ";"
+ "font-size:8pt;"
+ "font-family:Tahoma;"
+ "position:absolute;"
+ "cursor:default;"
+ "border:2px solid " + normal + ";"
+ "' "
+ "onmousedown='getFocus(this)'>"
+ "<div "
+ "style='"
+ "background-color:" + normal + ";"
+ "width:" + (this.width-2*2) + ";"
+ "height:20;"
+ "color:white;"
+ "' "
+ "onmousedown='startDrag(this)' "
+ "onmouseup='stopDrag(this)' "
+ "onmousemove='drag(this)' "
+ "ondblclick='min(this.childNodes[1])'"
+ ">"
+ "<span style='width:" + (this.width-2*12-4) + ";padding-left:3px;'>" + this.title + "</span>"
+ "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='min(this)'>0</span>"
+ "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='ShowHide(\""+this.id+"\",null)'>r</span>"
+ "</div>"
+ "<div style='"
+ "width:100%;"
+ "height:" + (this.height-20-4) + ";"
+ "background-color:white;"
+ "line-height:14px;"
+ "word-break:break-all;"
+ "padding:3px;"
+ "'>" + this.message + "</div>"
+ "</div>"
+ "<div id=xMsg" + this.id + "bg style='"
+ "width:" + this.width + ";"
+ "height:" + this.height + ";"
+ "top:" + this.top + ";"
+ "left:" + this.left + ";"
+ "z-index:" + (this.zIndex-1) + ";"
+ "position:absolute;"
+ "background-color:black;"
+ "filter:alpha(opacity=40);"
+ "'></div>";
document.body.insertAdjacentHTML("beforeEnd",str);
}
//显示隐藏窗口
function ShowHide(id,dis){
var bdisplay = (dis==null)?((document.getElementById("xMsg"+id).style.display=="")?"none":""):dis
document.getElementById("xMsg"+id).style.display = bdisplay;
document.getElementById("xMsg"+id+"bg").style.display = bdisplay;
}
//-->
</script>
<script language='JScript'>
<!--
function initialize()
{
var a = new xWin("1",160,200,200,200,"窗口1","xWin <br> A Cool Pop Div Window<br>XueMu.Net<br>2006-5-13");
var b = new xWin("2",240,200,100,100,"窗口2","Welcome to visited my personal website:<br><a href=http://www.xuemu.net target=_blank>http://www.xuemu.net</a><br>请多提建议噢<br><br>感谢您的关注!");
var c = new xWin("3",200,160,250,50,"窗口3","Copyright by <a href='#'>Wildwind</a>!");
ShowHide("1","none");//隐藏窗口1
}
window.onload = initialize;
//-->
</script>
</head>
<base target="_blank">
<body onselectstart='return false' oncontextmenu='return false' >
<a onclick="ShowHide('1',null);return false;" href="">窗口1</a>
<a onclick="ShowHide('2',null);return false;" href="">窗口2</a>
<a onclick="ShowHide('3',null);return false;" href="">窗口3</a>
</body>
</html>

TOP

推荐:最实惠的上海虹口婚庆公司

上海婚庆|亲相爱婚礼策划www.xiangai1314.com

客服热线:
殷先生:13472777790 徐小姐:15900979934
网址:  www.xiangai1314.cn   www.xiangai1314.com

MSN:xiangai1314520@hotmail.com
客服QQ:597125452
更多详细内容请登陆网站了解!!!


我们是专业婚礼一条龙服务的团队!人员方面都:是专业婚庆礼仪人员和团队组成,会场布置有专业的花店和花场做后盾!(在全市都有分布布置场地的场所来方便客户就近布置花车近的需要)在加上我们是省去了门面费用和人员中介费用,您找我们是最直接最实惠的选择!如果您有这方面需要,您可以浏览我们的网站浏览相关信息,具体问题您可以到我们这里来详细了解保证让您物有所值!!!
上海婚庆 上海杨浦婚庆 上海虹口婚庆 上海闸北婚庆 上海黄浦婚庆 婚礼 庆典 婚纱 婚纱摄影 钻石 婚宴 礼仪公司 庆典公司 喜庆 喜庆用品 模特礼仪 礼仪庆典 花车 鲜花 鲜花彩车 罗马柱 汽车租赁 庆典礼仪 模特公司 婚庆司仪 婚庆展览 婚庆展览会 婚庆博览会 婚庆主持人 婚庆主持人大赛 时尚 美容 化妆 结婚 蜜月 旅游 婚庆司仪 婚庆摄像 婚庆摄影 婚庆跟妆 婚庆公司 婚礼公司 婚礼策划 婚庆策划 彩妆摄影 上海婚庆 上海婚礼 上海婚庆公司 上海婚礼公司 上海婚礼策划公司 上海婚礼庆祝 上海婚庆策划 上海婚礼策划 上海婚礼婚庆策划 上海彩妆摄影 上海个性彩妆 上海时尚彩妆 上海婚纱摄影 上海婚纱照 上海影像 上海摄影 上海化妆 上海司仪 上海婚介所 上海婚介 上海婚介网站 上海婚介公司 上海婚介中心 北京婚庆网 中国婚庆网 婚庆网 婚礼网 庆典网 上海婚庆网 广州婚庆网 上海婚礼网 上海婚介协会 教堂婚礼 集体婚礼 舞蹈 舞狮 锣鼓 模特 演唱会 上海婚庆公司 上海婚庆用品 上海婚庆协会 北京经典婚庆久久 经典婚庆公司 婚庆用品 上海婚庆公司招聘 婚纱摄影  上海婚纱摄影 上海婚庆道具 上海婚庆行业协会 上海亲相爱婚礼策划 上海婚庆礼仪公司 上海普陀婚庆  上海长宁婚庆 上海徐汇婚庆 上海宝山婚庆 上海浦东婚庆

TOP

免费开通7钻,黑客学习如何免费开通7钻和各种QQ业务

免费开通7钻,黑客学习如何免费开通7钻和各种QQ业务

别说我骗人你先加我(QQ308501138)看看我的六钻美丽不
应用软件来点亮6个钻石把以下的软件安装后,刷新QQ就可以看到图表!可亮
稀饭提示最好先用一个试试看能否点亮!别贪心。
一个钻石回复代码6次后方能点亮你想点亮的钻要不就几个月要不就是终身免费的有没有业务就不太清楚了~!   
注:只有全部粘帖后才能都显示出来 要不就都不显示了 绝对真实

http://www.aicaiwz.com   

TOP

Wedding for www.xiangai1314.cn

亲相爱婚礼策划
婚庆会场绢花布置+设备租用超值套餐1588元
1、欧式星光背景布置
2、流水灯布置
3、绢花拱门布置或迎宾背景布置
4、过道绢花立亭拉纱布置6个
5、10桌内绢花烛台布置
6、烛光晚会绢花水晶大烛台布置
7、七彩荧光冰(香槟用)
8、签到台布置
9、欢迎牌一个
10、婚房布置
11、交杯酒杯绢花布置
12、泡炮机
13、话筒绢花布置
14、新人椅背布置
15、海报架一个
16、婚庆流程策划单
17、现场督导
18、戒枕租用一个
19、欧式白地毯或红地毯装饰(二选一)
预定此套餐还可享受:
享受四大金刚最优价480元/位(摄像、摄影、化妆、司仪)
殷先生:13472777790 徐小姐:15900979934
网址:www.xiangai1314.com
www.xiangai1314.cn www.xiangai1314.net
MSN:xiangai1314520@hotmail.com
客服QQ:597125452

TOP

发新话题