您好,欢迎来到模板无忧!
登录
注册
閺€鎯版
閹兼粎鍌�
閸︽澘娴�
鐢喖濮�
模板无忧
网页特效
每日更新
|
TOP排行榜
|
Tag标签
|
充值
无忧首页
网页模板
程序模板
建站教程
视频教程
网页特效
图标素材
字体下载
站长工具
站长问答
关闭顶部
展开顶部
网页特效
菜单导航
图片特效
文本链接
层和布局
页面背景
表单按钮
日期时间
计算转换
键盘鼠标
浏览器
游戏娱乐
综合其它
常用代码
jQuery特效
Prototype
Ajax/JavaScript
ExtJS
CSS特效
在线编辑器
Mootools
HTML
JS广告代码合集
站长工具
站长常用软件
网站综合查询
Alexa排名查询
Google PR查询
域名Whois查询
网站收录查询
友情链接查询
CSS2中文手册
CSS精简优化工具
AI鐏忓繗浠� 閼宠棄鍟撴导姘辨暰
閸╃喎鎮�
閹恒劏宕�
展开边栏
关闭边栏
网页特效代码
模板无忧
>
网页特效
>
浏览器特效代码
>
收藏
分享
查看评论
浏览器
演示
3个不同高度的三维可拖动图层_浏览器特效
查看演示效果
特效Tag:
拖动
高度
添加
缂佸洦鈪礑edeCMS鐟欏棝顣堕弫娆戔柤
娑旀壆鈹栭梻锟� 缁夌喐婀囬崝鈥虫珤 闁缍夌涵鏇氱鞍閼辨棑绱�
閺冪姴鍜栫粩娆撴毐瀹搞儱鍙�,閻ф儳瀹抽弶鍐櫢娑撯偓闁款喖鍙忛弻锟�!
3个不同高度的三维可拖动图层,您可以先修改部分代码再运行.
<html> <head> <title>_xWin-模板无忧www.mb5u.com</title> <style type='text/css'> <!-- 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='slategray';//color; var index=10000;//z-index; //开始拖动; function startDrag(obj) { //锁定标题栏; 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) { var win = obj.parentNode; var sha = win.nextSibling; if(moveable) { 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) { var win = obj.parentNode; var sha = win.nextSibling; win.style.borderColor = normal; obj.style.backgroundColor = normal; obj.nextSibling.style.color = normal; sha.style.left = obj.parentNode.style.left; sha.style.top = obj.parentNode.style.top; //放开标题栏; obj.releaseCapture(); moveable = false; } //获得焦点; function getFocus(obj) { 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 cls(obj) { var win = obj.parentNode.parentNode; var sha = win.nextSibling; win.style.visibility = "hidden"; sha.style.visibility = "hidden"; } //创建一个对象; 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:10px;" + "font-family:Verdana;" + "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)' " + ">" + "<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='cls(this)'>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 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>"; //alert(str); document.body.insertAdjacentHTML("beforeEnd",str); } //--> </script> <script language='JScript'> <!-- function initialize() { var a = new xWin("1",160,200,200,200,"Message","xWin <br> A Cool Pop Div Window<br>Version:1.0<br>2002-8-13"); var b = new xWin("2",240,200,100,100,"Wildwind's Msgbox","Welcome to visited my personal website:<br><a href=http://www14.brinkster.com/wildcity target=_blank>http://www.xufei.net</a><br>and u can also sign my guestbook at:<br><a href=http://www14.brinkster.com/wildcity/gbook target=_blank>http://www.xufei.net/gbook</a><br><br>thx!!! =)..."); var c = new xWin("3",200,160,250,50,"Copyright","Copyright by <a href='mailto:wildwind_zz@21cn.com'>Wildwind</a>!"); } window.onload = initialize; //--> </script> </head> <body onselectstart='return false' oncontextmenu='return false'> </body> </html>
所属频道:
浏览器特效
/
更新时间:2012-11-19
[收藏]
[报错]
[返回列表]
评论加载中....
相关
浏览器特效
:
JS判断客户端使用的访问设备并加载对应CSS
对输入文本框的内容作出检测
对链连接进行确认还能给出有关提示
检测浏览器去过站点
集成Cookies :能在页面显示用户的很多信息
显示随来访次数信息
禁用鼠标右键:禁用鼠标右键功能
离开页面,提示用户把本页添加到收藏夹
禁用鼠标左键:禁用鼠标左键功能
签名提示程序:提示用户签到,并在页面给出欢迎语
标题栏里的打字效果
检测出用户的IE浏览器所装插件数
浏览器特效Rss订阅
特效代码搜索
浏览器特效推荐
标题栏显示闪烁文字
JS屏蔽IE网页的F5刷新键
打开网页自动最大化的JavaScript代码
鼠标跟随代码,转动的文字
网页Loading,让页面加载完再显示
自由控制打开的窗口
测试窗口是否打开
禁用鼠标左键:禁用鼠标左键功能
一个游戏网站的网页进度条
让网页窗口始终显示一半且居中的JS代码
猜你也喜欢看这些
推箱子
模拟跳舞
选择喜欢的女孩子类型噢~
类似于乒乓球的网页游戏
鼠标测试
反应能力测试游戏,你能坚持多久?
试试你的运气找好东东
健康值测试
JavaScript撞球游戏
Tic Tac Toe 双人版
相关链接:
复制本页链接
|
搜索3个不同高度的三维可拖动图层
特效说明:
浏览器模板
-
3个不同高度的三维可拖动图层
。
閺€鎯版&閸掑棔闊�
QQ缁屾椽妫�
閺傜増姘顔煎触
閼垫崘顔嗗顔煎触
娴滆桨姹夌純锟�
瀵偓韫囧啰缍�
閻ф儳瀹抽幖婊嗘
婢跺秴鍩楃純鎴濇絻
閺囨潙顦�...