爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
随意移动的表格
随意移动的表格
日期:2014-05-18 浏览次数:20190 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <SCRIPT language=javascript> var theobject = null; function resizeObject() { this.el = null; this.dir = ""; this.grabx = null; this.graby = null; this.width = null; this.height = null; this.left = null; this.top = null; } function getDirection(el) { var xPos, yPos, offset, dir; dir = ""; xPos = window.event.offsetX; yPos = window.event.offsetY; offset = 8; //The distance from the edge in pixels if (yPos<offset) dir += "n"; else if (yPos > el.offsetHeight-offset) dir += "s"; if (xPos<offset) dir += "w"; else if (xPos > el.offsetWidth-offset) dir += "e"; return dir; } function doDown() { var el = getReal(event.srcElement, "className", "resizeMe"); if (el == null) { theobject = null; return; } dir = getDirection(el); if (dir == "") return; theobject = new resizeObject(); theobject.el = el; theobject.dir = dir; theobject.grabx = window.event.clientX; theobject.graby = window.event.clientY; theobject.width = el.offsetWidth; theobject.height = el.offsetHeight; theobject.left = el.offsetLeft; theobject.top = el.offsetTop; window.event.returnValue = false; window.event.cancelBubble = true; } function doUp() { if (theobject != null) { theobject = null; } } function doMove() { var el, xPos, yPos, str, xMin, yMin; xMin = 8; yMin = 8; el = getReal(event.srcElement, "className", "resizeMe"); if (el.className == "resizeMe") { str = getDirection(el); if (str == "") str = "default"; else str += "-resize"; el.style.cursor = str; } if(theobject != null) { if (dir.indexOf("e") != -1) theobject.el.style.width = Math.max(xMin, theobject.width + window.event.clientX - theobject.grabx) + "px"; if (dir.indexOf("s") != -1) theobject.el.style.height = Math.max(yMin, theobject.height + window.event.clientY - theobject.graby) + "px"; if (dir.indexOf("w") != -1) { theobject.el.style.left = Math.min(theobject.left + window.event.clientX - theobject.grabx, theobject.left + theobject.width - xMin) + "px"; theobject.el.style.width = Math.max(xMin, theobject.width - window.event.clientX + theobject.grabx) + "px"; } if (dir.indexOf("n") != -1) { theobject.el.style.top = Math.min(theobject.top + window.event.clientY - theobject.graby, theobject.top + theobject.height - yMin) + "px"; theobject.el.style.height = Math.max(yMin, theobject.height - window.event.clientY + theobject.graby) + "px"; } window.event.returnValue = false; window.event.cancelBubble = true; } } function getReal(el, type, value) { temp = el; while ((temp != null) && (temp.tagName != "BODY")) { if (eval("temp." + type) == value) { el = temp; return el; } temp = temp.parentElement; } return el; } document.onmousedown = doDown; document.onmouseup = doUp; document.onmousemove = doMove; </SCRIPT> <SCRIPT language=javascript> if (moz) { extendElementModel(); extendEventObject(); emulateEventHandlers(["mousemove", "mousedown", "mouseup"]); } </SCRIPT> <STYLE> #simple { BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; Z-INDEX: 2; BACKGROUND: white; LEFT: 60px; OVERFLOW: hidden; BORDER-LEFT: white 1px solid; WIDTH: 400px; BORDER-BOTTOM: white 1px solid; POSITION: absolute; TOP: 80px; HEIGHT: 100px } </STYLE> <table class=resizeMe id=simple border="1" width="100%" height="100%"> <tr> <td width="8%"> </td> <td width="8%"> </td> <td width="8%"> </td> <td width="8%"> </td> <td width="8%"> </td> </tr> <tr> <td width="8%"> </td> <td width="8%"> &l
上一篇:狡猾的按钮特效
下一篇:打开链接后没有后退
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
小米发明的“低价抢购”模式还能管用多久?
原万网CTO周雷加盟亿玛 出任CTO一职
全球五大电信设备商业绩:华为净利居首
百度透露无人驾驶战略 研发三维交通地图
成本效益全兼顾 混合云市场前景显现
牟贵先挂帅 国美在线“价钱战”昔日开打
郭美美事件推手被抓 “秦火火”拷问网络底线
华为任正非:家族成员不会成为接班人
锐迪科将以9.25美元/ADS价钱出售835万份ADS
推荐阅读
更多>
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
苹果iWatch或使用量产液态金属 将取代玻璃
支付宝全面封杀比特币:充值码淘宝店或遭封禁
北京电信推“0月租卡”,同网通话免费
华为坚持不上市究竟为何?不差钱也不想冒风险
空气污染器市场乱象丛生 选购需慎重
携程整合去哪儿陷入僵局 欲联手老对手艺龙
FB上广告费用昂贵而且效果不及Twitter
二维码支付大战的号角注定已经吹响,尚需标准发放
工商下月将整治手机市场
阿里入股虎嗅:媒体的脊梁弯了?未必!
华为野心布局未来:投资研发5G对赌1毫秒连接
继续涨:微博IPO第二交易日 收盘大涨11.71%
迅雷高管解读财报:收购快盘可快速融入小米
Facebook以“人”为本的名义占领安卓
巨人网络回应央视 否认应用黑客停止诈骗
宽带中国战略明确 运营商建设成本超6000亿
玩游戏式的趣味戒烟App:Kwit
快播灭了,还有西瓜:视频网站的灰色江湖还在