爱易网
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 浏览次数:20249 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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
上一篇:狡猾的按钮特效
下一篇:打开链接后没有后退
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
网友爆料称微软雇水军宣传主机Xbox One
充斥着假消息负能量的“秘密”缺乏普适性
工信部或本月17日向联通电信颁发FDD牌照
清点:罗永浩推锤子ROM 小米打法遭模拟
百视通:Xbox One汉化获批 游戏迷欢呼吧
三星手机在国内陷入困境:华为中兴小米紧追
十亿美元的告别礼:三星为何要大举重组?
Twitter收购印度手机营销公司ZipDial
苹果30亿美元收购Beats
推荐阅读
更多>
刘强东向总理建言:打击有组织有规模的售假商家
网曝富士康500万iphone遭退货是确证的事
京东终于想明白,这些年错过的财运,都藏在女人的时装下
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
MIUI,有了它小米就无惧对手
火狐手机发展前路:或被运营商绑架
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
百度吴恩达:图像和音视频搜索是人工智能新方向
苹果大中华区业绩回暖 中移动贡献或低于预期
广东移动董事长徐龙受调查 圈内对其褒贬不一
唯品会荣登“最贵中概股”的欢喜与哀愁
Facebook思科联手推免费WiFi 欲覆盖全美
iPhone 6 Plus要召回是谣言
工商下月将整治手机市场
英特尔涉嫌垄断 欧盟或开出史上最高罚单
百度对糯米来说到底意味着什么?
银河证券王锦炎:金融业如何使用大数据
联发科享用价钱战 专利难以摆脱高通
微软张亚勤趋势判断:未来三十年属于物理化互联网
只有切到刚需痛点,漫画APP才能走下去