爱易网
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 浏览次数:20254 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>爱易网网页特效演示,可以控制旋转的图像</title> </head> <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 cur
上一篇:狡猾的按钮特效
下一篇:明暗变化的二张图片
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
诺基亚若没加入微软,只不过是另一个HTC而已
三星已经将Galaxy S5视为失败之作?
欧洲6万人起诉Facebook隐私侵权
阿里收购UC 五年姻缘换来移动新格局
支付宝被曝严重破绽 隐私平安再受质疑
人们为什么总愿尝试新社交网络?
看,网络文学今日之繁盛;忆,纯真去哪了?
美国电影协会在华起诉迅雷侵权 要求赔偿并道歉
索尼移动中国区陷裁员风波:业务不佳 员工焦虑
推荐阅读
更多>
谷歌欲收买WhatsApp添加砝码 对方否认
二维码支付大战的号角注定已经吹响,尚需标准发放
互联网情色众多 Facebook与9158态度大不同
电信运营商员工涌入虚拟运营商,待遇差距多大?
中移动一季度净利大降:手机补贴增长过快
百视通:Xbox One汉化获批 游戏迷欢呼吧
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
评论:马云的成功建立在什么基础上很值得怀疑
苹果MacBook Air劣势渐显 或推新产品改变命运
埃里克杰克森:阿里IPO估值至少1500亿美元
任正非:喜马拉雅山的水为什么不能流入亚马逊河?
虚拟运营商流量不清零吸引用户 盈利待明
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
中国邮政与阿里合作:邮政网点可做网购自提点
京东微信入口战略能否助力618大促创流量巅峰
马云寄厚望于物流 “菜鸟”行情暂难持续
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
火一把就死: 百度魔图验证社交游戏衰亡宿命
据消息传百度将要控股携程 整合去哪儿
中移动五大基地将整改成公司:被指易滋生腐败