爱易网
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 浏览次数:20256 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:明暗变化的二张图片
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
苹果联合创始人炮轰鲍尔默“一直都在吃老本”
喜大普奔:2016年国内乘客有望在飞机上使用手机
苹果30亿美元收购Beats
PC迎9年来出货量新低 平板电脑渐成主流
搜狐与奇虎360或结盟对抗BAT
孙正义入股阿里往事还原:阿里巴巴并非软银首选
Android版WhatsApp曝漏洞:聊天记录可被窃取
传三星为赢得新兴市场:推廉价版Note3
眼球识别技术EyeVerify融资600万美元 360参投
推荐阅读
更多>
继续涨:微博IPO第二交易日 收盘大涨11.71%
电信业营改增今起实施 运营商短期利润骤降
迅雷向美SEC提交IPO招股书:拟最多筹资1亿美元
网络音乐非片面收费 高晓松时间表难完成
易信工具性优势突出 丁磊三板斧或先砍在飞信上
优酷土豆兼并一年:依然处于烧钱形状
眼球识别技术EyeVerify融资600万美元 360参投
刘强东:京东上市融资用于开拓三至六线城市
马云寄厚望于物流 “菜鸟”行情暂难持续
华为、小米和联想在中国手机市场上演“三国杀”
揭秘:阿里巴巴“无人认领”的三成股权都归谁
iSuppli:上网本将于2015年退出市场
墨迹天气:产品创新以攻为守方能对抗巨头
“世界杯+618”集体磨刀的本质是绑架全民
三星已经将Galaxy S5视为失败之作?
“论文查重”网店一月收入竟过百万
京东联席董事长赵国庆上市前夕离职
扎克伯格华裔妻子首度亮相电视节目畅谈情史
首批四款“官方”打车软件发布:均为安卓版本
微博启动自媒体计划 粉丝+收入双激励是亮点