爱易网
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 浏览次数:20209 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <script type="text/javascript"> function Path() { this.concat = int_concat; this.add = int_add; this.rotate = int_rot; function int_concat(p) { return new PathList(new Array(this, p)); } function int_add(p) { return new PathAdd(this, p); } function int_rot(xc,yc,v) { return new RotatePath(this, xc, yc, v); } } // The following object is used for the concat function PathList(inPathList) { // All path objects must have these 5 methods this.x = 0; // Retrieves the current x value this.y = 0; this.step = int_step; // Move to next step this.reset = int_reset; // Resets the current position // The rest may vary from different path objects this.pathList = inPathList; this.currentPath = 0; function int_step() { if (this.currentPath >= this.pathList.length) return false; if (this.pathList[this.currentPath].step()) { this.x = this.pathList[this.currentPath].x; this.y = this.pathList[this.currentPath].y; } else { this.currentPath++; if (this.currentPath >= this.pathList.length) return false; this.x = this.pathList[this.currentPath].x; this.y = this.pathList[this.currentPath].y; } return true; } function int_reset() { this.currentPath = 0; for (var i=0; i<this.pathList.length; i++) this.pathList[i].reset(); this.x = this.pathList[this.currentPath].x; this.y = this.pathList[this.currentPath].y; } } // The following object is used for adding two paths function PathAdd(p1,p2) { // All path objects must have these 5 methods this.x = 0; // Retrieves the current x value this.y = 0; this.step = int_step; // Move to next step this.reset = int_reset; // Resets the current position // The rest may vary from different path objects this._p1 = p1; this._p2 = p2; function int_step() { var c1 = this._p1.step(); var c2 = this._p2.step(); this.x = this._p1.x + this._p2.x; this.y = this._p1.y + this._p2.y; return (c1 || c2); } function int_reset() { this._p1.reset(); this._p2.reset(); this.x = this._p1.x + this._p2.x; this.y = this._p1.y + this._p1.y; } } function RotatePath(p,xc,yc,v) { this.x = 0; // Retrieves the current x value this.y = 0; this.step = int_step; // Move to next step this.reset = int_reset; // Resets the current position // The rest may vary from different path objects this._p = p; this._xc = xc; this._yc = yc; this._v = v; function int_step() { var c = this._p.step(); var pol = toPol(this._p.x - this._xc, this._p.y - this._yc); var rec = toRec(pol.r, pol.v + toRad(this._v)); this.x = rec.x + this._xc; this.y = rec.y + this._yc; return c; } function int_reset() { this._p.reset(); var pol = toPol(this._p.x - this._xc, this._p.y - this._yc); var rec = toRec(pol.r, pol.v + toRad(this._v)); this.x = rec.x - this._xc; this.y = rec.y - this._yc; } function toPol(x,y) { var o = new Object(); o.r = Math.sqrt(x*x + y*y); if (x == 0) o.v = Math.PI / 2; else o.v = Math.atan(y/x); if (x < 0) o.v = o.v + Math.PI; return o; } function toRec(r,v) { var o = new Object(); o.x = r * Math.cos(v); o.y = r * Math.sin(v); return o; } function toRad(deg) { return deg*Math.PI/180; } } PathAdd.prototype = new Path; PathList.prototype = new Path; RotatePath.prototype = new Path; </script> <script type="text/javascript"> function CirclePath(x, y, _xr, _yr, fromV, toV, n) { // All path objects must have these 5 methods this.x = 0; // Retrieves the current x value this.y = 0; this.step = int_step; // Move to next step this.reset = int_reset; // The rest may vary from different path objects
上一篇:狡猾的按钮特效
下一篇:点击使图片大小变化
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
阿里巴巴450亿勾画“现代服务业”藏宝图
团购网站存活率仅18.6% 剩余缺乏千家
谁说黑莓没救?他们在悄悄地深耕企业级市场,在这个领域,苹果三星算什么,他们远远不是黑莓的对手
FB上广告费用昂贵而且效果不及Twitter
苹果CEO抱歉解读:是战略而非“屈服”
公信力消失:马航事件社交媒体传播之痛
三星石墨烯制备技术获突破
国美苏宁线上首度正面PK 京东列席4月电商战
小微型IDC云化趋势加剧 云计算未来或现终极模式
推荐阅读
更多>
微软最后的救命稻草Win 8份额继续上升
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
猎豹移动上市押海外市场 与小米有合作空间
《中国三网融合业务运营管理》研讨报告征订函
亚马逊落户上海自贸区:美国货直邮中国
称产品遭诋毁 奇虎再诉百度
工商下月将整治手机市场
一个非脑残米粉的思考:小米“成功之道”如何炼成
杨元庆去年总薪酬1.33亿元
蜗牛移动董事长石海:号卡被叫停属乌龙事件
如家撤离同程内情:祸起反水OTA“联盟”?
iOS7拖累iPad 5、iPad mini2发布 传十月份推出
虚拟运营商前路迷茫 业界建议发力车联网
永不磨灭的九大尖端编程语言
固话上网卡或将实名制 运营商泄露用户信息将被罚
宽带中国战略明确 运营商建设成本超6000亿
【晚报】女子泰国游晒10照片 流量费2000
解析2014年阿里百度等五大互联网巨头深度布局
云储存有多远:跨过数据安全问题即可到达
聚美优品获基石投资1.5亿美金,IPO吃下定心丸