跟随鼠标旋转的文字

if (document.all) {
yourLogo = "我们欢迎您的光临";
logoFont = "宋体";
logoColor = "000000";
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 100;
logoHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('

');
for (i = 0; i '+yourLogo[i]+'

');
}
document.write('

');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

这是一段跟随鼠标旋转的文字,我希望字体在旋转的时候,每一个字的颜色都互不相同。不知道应该如何实现呢?

if (document.all) {
yourLogo = "七度空间欢迎您的光临";
logoFont = "宋体";
logoColor = ["F0F8FF","FAEBD7","00FFFF","7FFFD4","F0FFFF","F5F5DC","FFE4C4","000000","FFEBCD","0000FF","8A2BE2","A52A2A","DEB887","5F9EA0","7FFF00","D2691E","FF7F50","6495ED","FFF8DC","DC143C","00FFFF","00008B","008B8B","B8860B","A9A9A9","006400","BDB76B","8B008B","556B2F","FF8C00","9932CC","8B0000","E9967A","8FBC8B","483D8B","2F4F4F","00CED1","9400D3","FF1493","00BFFF","696969","1E90FF","B22222","FFFAF0","228B22","FF00FF","DCDCDC","F8F8FF","FFD700","DAA520","808080","008000","ADFF2F","F0FFF0","FF69B4","CD5C5C","4B0082","FFFFF0","F0E68C","E6E6FA","FFF0F5","7CFC00","FFFACD","ADD8E6","F08080","E0FFFF","FAFAD2","90EE90","D3D3D3","FFB6C1","FFA07A","20B2AA","87CEFA","778899","B0C4DE","FFFFE0","00FF00","32CD32","FAF0E6","FF00FF","800000","66CDAA","0000CD","BA55D3","9370DB","3CB371","7B68EE","00FA9A","48D1CC","C71585","191970","F5FFFA","FFE4E1","FFE4B5","FFDEAD","000080","FDF5E6","808000","6B8E23","FFA500","FF4500","DA70D6","EEE8AA","98FB98","AFEEEE","DB7093","FFEFD5","FFDAB9","CD853F","FFC0CB","DDA0DD","B0E0E6","800080","FF0000","BC8F8F","4169E1","8B4513","FA8072","F4A460","2E8B57","FFF5EE","A0522D","C0C0C0","87CEEB","6A5ACD","708090","FFFAFA","00FF7F","4682B4","D2B48C","008080","D8BFD8","FF6347","40E0D0","EE82EE","F5DEB3","F5F5F5","FFFF00","9ACD32"];
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 100;
logoHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('

');
for (i = 0; i '+yourLogo[i]+'

');
}
document.write('

');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

(0)

相关推荐

  • 跟随鼠标旋转的文字

    if (document.all) { yourLogo = "我们欢迎您的光临"; logoFont = "宋体"; logoColor = "000000"; yourLogo = yourLogo.split(''); L = yourLogo.length; TrigSplit = 360 / L; Sz = new Array() logoWidth = 100; logoHeight = -30; ypos = 0; xpos = 0

  • JS实现跟随鼠标的链接文字提示框效果

    本文实例讲述了JS实现跟随鼠标的链接文字提示框效果.分享给大家供大家参考.具体如下: 这里使用JavaScript与CSS实现链接提示效果,不会改变你原来的链接结构,使用链接原有的title标签来实现,如果之前你使用有title标签,那你几乎只需把JS代码拷贝到你的网页中即可.你会发现,运行本效果后,鼠标在链接上移动的话,文字提示框会跟随鼠标而移动位置. 运行效果如下图所示: 具体代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tran

  • JavaScript实现文字跟随鼠标特效

    本文实例讲述了JavaScript如何实现文字跟随鼠标特效.分享给大家供大家参考.具体如下: 运行效果图如下: <HTML> <HEAD> <TITLE>鼠标特效--文本围绕鼠标</TITLE> </HEAD> <BODY> <br><br> <center> <font color="red"><h2>鼠标特效--文本围绕鼠标</h2><

  • js实现文字跟随鼠标移动而移动的方法

    本文实例讲述了js实现文字跟随鼠标移动而移动的方法.分享给大家供大家参考.具体分析如下: 这是一款非常简单的鼠标特性代码,在网页中移动鼠标的时候,后面跟着一串文字跟随者鼠标移动 复制代码 代码如下: <html> <head> <style type="text/css"> .spanstyle { COLOR: 000000; FONT-SIZE: 10pt; POSITION: absolute; TOP: -50px; VISIBILITY:

  • javascript跟随鼠标的文字带滚动效果

    比较简单常用的跟随鼠标文字滚动效果 跟随鼠标的文字带滚动效果 var scroller_msg='欢迎进入我的站点' var dismissafter=0 var initialvisible=0 if (document.all) document.write(''+scroller_msg+'') function followcursor(){ //move cursor function for IE if (initialvisible==0){ curscroll.style.vis

  • 给blog添加效果(计数器、天气预报、精美flash时钟、跟随鼠标的萤火虫、跟随鼠标的文字、状态栏文本、副标

    示例:http://blog.csdn.net/kvw3000本文收集整理而来,感谢各段代码提供者! 整理:回家念经(王结太) 1. 公告和计数器2. 天气预报 3. 跟随鼠标的萤火虫4. 状态栏文本5. 跟随鼠标的文字6. 每次打开的时候自动在顶部副标题位置显示一条不同格言7. flash精美时钟(新增) 在"选项"->"配置"的"静态新闻/声明"中加入下面相应的语句就可以实现相应的功能: 1. 公告和计数器代码: 代码填写在静态新闻/声

  • 原生JS实现的多个彩色小球跟随鼠标移动动画效果示例

    本文实例讲述了原生JS实现的多个彩色小球跟随鼠标移动动画效果.分享给大家供大家参考,具体如下: 实现方法: 每个小球移动都有自己的坐标,小球移动的同时,需要进行坐标传递,将第一个坐标依次传递给最后一个坐标,来实现小球跟着移动的效果 实现代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小球运动</title> <style type

  • 原生JS+HTML5实现跟随鼠标一起流动的粒子动画效果

    本文实例讲述了原生JS+HTML5实现跟随鼠标一起流动的粒子动画效果.分享给大家供大家参考,具体如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset=gbk> <title>www.jb51.net 粒子效果演示</title> <meta name="description" content="HTML5/canva

  • Unity3D使用鼠标旋转缩放平移视角

    Unity使用鼠标旋转缩放平移视角,供大家参考,具体内容如下 用代码在Game界面完美实现Scene界面的操作方法. 使用方法:把脚本挂在相机上,把跟踪的target拖到脚本上. 视角跟踪的是一个空物体,当然如果你是做RPG游戏需要跟踪某一角色的视角,那就不需要中键平移功能,把空物体换成角色就行. 代码主要是分三部分功能进行实现. 1.右键拖动控制视角的旋转: 2.滚轮旋转控制视角的缩放: 3.中键拖动控制视角的平移. 右键拖动控制旋转主要是用GetAxis获得鼠标在x方向与y方向平移的距离,相

  • html+css+js实现canvas跟随鼠标的小圆特效源码

    效果(源码在最后): 实现: 1.定义标签: <h1>北极光之夜</h1> <canvas id="draw" style=" position: fixed; display: block;"> 当前浏览器不支持Canvas,请更换浏览器后再试 </canvas> 2. 文字的基本样式: h1{ position: absolute; top: 50%; left: 50%; transform: translate

随机推荐