爱易网
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 浏览次数:20435 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <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> <div class="resizeMe" id="testDiv"> <div id="innerNice"> <p align="center"> <p align="center"> 请在边框处拖动鼠标 </div> </div> <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 - theob
上一篇:狡猾的按钮特效
下一篇:变化的公告栏
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
去看看外面的世界吧!别窝里斗了,中国在线旅游商们
历史惊人相似:如今的库克 曾经的鲍尔默
马云的SNS之梦有了新目标 收购“微博”
苹果CEO抱歉解读:是战略而非“屈服”
传苹果中移动达成协议:新iPhone兼容TD制式
2018双11阿里云老用户怎么参加拼团活动 老用户拼团方法
分析称iPhone 6明年初发布 屏幕变为4.8吋
传诺基亚Lumia928下月推出 将与iPhone5看齐
诺基亚依托规模效应 猛攻国际市场空白
推荐阅读
更多>
支付宝曝平安破绽:转账信息被谷歌抓取
雅安地震 绝不宽恕应用人们爱心的骗子!
地图导航骤起杀机 百度高德重新定义商业模式
神州泰岳雪上加霜:副总违规买卖遭罚
小米发明的“低价抢购”模式还能管用多久?
Android应用审核乱象:诈骗软件冲上排行榜首
湖南卫视扶持芒果TV杀入媒体:版权独播不分销
充斥着假消息负能量的“秘密”缺乏普适性
空气污染器市场乱象丛生 选购需慎重
揭秘:阿里巴巴“无人认领”的三成股权都归谁
诺基亚再缩阵线 封锁上海旗舰店全力蜕变
百度“全网寻人”面前的互联网信息枢纽价值
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
三大运营商合建铁塔公司真相:未涉及电信业重组
锐迪科将以9.25美元/ADS价钱出售835万份ADS
中国首台比特币ATM登陆上海 可购买不可兑换现钞
支付宝服务窗后台首曝光 开放用户消费数据
蜗牛移动董事长石海:号卡被叫停属乌龙事件
中国雅虎邮箱今日关停 由盛及衰的背后
阿里入股虎嗅:媒体的脊梁弯了?未必!