爱易网
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 浏览次数:20253 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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
上一篇:狡猾的按钮特效
下一篇:打开链接后没有后退
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
网络音乐非片面收费 高晓松时间表难完成
优酷土豆携手新浪微博 谋攻移动视频失地
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
中移动五大基地将整改成公司:被指易滋生腐败
小灵通两年都无信号 顾客起诉联通公司
中移动推动感地带3G网聊卡 火拼微信沃卡
阿朗力避步北电后尘 急切停止自我革新
清点:罗永浩推锤子ROM 小米打法遭模拟
iPhone5S组件曝光 印证杀手级功能存在
推荐阅读
更多>
火一把就死: 百度魔图验证社交游戏衰亡宿命
纸媒深探版权蓝海抗衡互联网的时机到来了
国美苏宁线上首度正面PK 京东列席4月电商战
让一让,小米4来了,碰见米粉请务必绕道走!
创维冲击500亿梦想:转型硬件和内容供应商
阿朗力避步北电后尘 急切停止自我革新
网易微博将正式关闭 用户迁至轻博客LOFTER
携程整合去哪儿陷入僵局 欲联手老对手艺龙
互联网金融一周年:余额宝最接地气,比特币最作死
FDD牌照12月将发放 联通电信双4G反击中移动
网络音乐非片面收费 高晓松时间表难完成
史玉柱谈创业:5大建议 失败的教训最真实
工商下月将整治手机市场
第二梯队也PK:当1号店“遇上”京东手机节
雷军会做赔钱生意?迅雷跌破发行价 市值仅7亿美元
刘强东:京东上市融资用于开拓三至六线城市
百度透露无人驾驶战略 研发三维交通地图
小灵通两年都无信号 顾客起诉联通公司
挂号网高管团体离任 或因投资人失掉决计
腾讯为何在与阿里百度的收购比赛中当看客?