爱易网
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 浏览次数:20626 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <title>改变层的大小-爱易网WEB开发www.aiyiweb.com</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"> <style> { box-sizing: border-box; moz-box-sizing: border-box } #testDiv { background-color: buttonface; background-repeat: repeat; background-attachment: scroll; color: #3969A5; height: 300px; left: 30px; overflow: hidden; width: 500; z-index: 2; border: 2px outset white; margin: 0px; padding: 2px; background-position: 0% 50% } body { font-family: Verdana; font-size: 9pt } #innerNice { background-color: white; background-repeat: repeat; background-attachment: scroll; color: #3969A5; height: 100%; overflow: auto; width: 100%; border: 2px inset white; padding: 8px; background-position: 0% 50% } </style> <SCRIPT language=javascript> ///////////////////////////////////////////////////////////////////////// // Generic Resize by Erik Arvidsson // // // // You may use this script as long as this disclaimer is remained. // // See www.dtek.chalmers.se/~d96erik/dhtml/ for mor info // // // // How to use this script! // // Link the script in the HEAD and create a container (DIV, preferable // // absolute positioned) and add the class="resizeMe" to it. // ///////////////////////////////////////////////////////////////////////// var theobject = null; //This gets a value as soon as a resize start function resizeObject() { this.el = null; //pointer to the object this.dir = ""; //type of current resize (n, s, e, w, ne, nw, se, sw) this.grabx = null; //Some useful values this.graby = null; this.width = null; this.height = null; this.left = null; this.top = null; } //Find out what kind of resize! Return a string inlcluding the directions 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; //The smallest width possible yMin = 8; // height el = getReal(event.srcElement, "className", "resizeMe"); if (el.className == "resizeMe") { str = getDirection(el); //Fix the cursor if (str == "") str = "default"; else str += "-resize"; el.style.cursor = str; } //Dragging starts here 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) theo
上一篇:狡猾的按钮特效
下一篇:确认关闭窗
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
小米移动芯片:英伟达退出,终会加强与联发科合作
中国手游总裁及8名高管集体下岗,被指涉不当交易
移动联通回应税率改革:短期内收入利润将大减
广东移动董事长徐龙受调查 圈内对其褒贬不一
酷派首抓4G时机大丰收,未来份额必降无疑
独立工具APP:为亿级用户的商业化而愁
从WPS到office365,中国企业能否赶超美国?
PC迎9年来出货量新低 平板电脑渐成主流
支付宝被曝严重破绽 隐私平安再受质疑
推荐阅读
更多>
MIUI,有了它小米就无惧对手
余额宝收益率跌破5% 银行系宝宝收益率赶超
联想国庆完成收购IBM x86服务器
戴尔新CEO名单曝光:惠普甲骨文高管在列
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
美图手机2问世 三大问题令其市场销量堪忧
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
马云寄厚望于物流 “菜鸟”行情暂难持续
承载京东C2C野心的拍拍网:梦想丰满,现实骨感
喜大普奔:2016年国内乘客有望在飞机上使用手机
OPPO Find7体验测 Find7综测
小微型IDC云化趋势加剧 云计算未来或现终极模式
小米2S试水高端化 纯“性价比”玩法已成过去式
快递企业征收“份子钱” 成全了谁 苦了谁?
618首日看京东阿里不同策略,鹿死谁手?
巧用百度推行系统 突显竞价效果
马云自称在美国曾被绑票
中移动“重启”自有品牌手机成败难料
让一让,小米4来了,碰见米粉请务必绕道走!
酷派首抓4G时机大丰收,未来份额必降无疑