js特效文本跟随鼠标移动_第1页
js特效文本跟随鼠标移动_第2页
js特效文本跟随鼠标移动_第3页
js特效文本跟随鼠标移动_第4页
js特效文本跟随鼠标移动_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1 打开新页面鼠标特效篇-打开新页面鼠标特效篇-打开新页面function OpenWindow () msg=open(, NewWindow, toolbar=yes, location=no, directories=yes, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=420, height=240);2 文本框问绕鼠标鼠标特效篇-文本围绕鼠标鼠标特效篇-文本围绕鼠标var cx=0;var cy=0;var val=0;function MouseTextStart() fo

2、r(i=1;i=7;i+) val=setInterval(MouseTextShow(1),20); setInterval(MouseTextfollow(+i+),100); function MouseTextShow(i) var w=eval(MouseText+i); with(w.style) visibility=visible; s=parseInt(fontSize); if(s=200)s-=100; else if(s90&s=100) s-=85; clearInterval(val); if(i7)val=setInterval(MouseTextShow(+(i

3、+1)+),20); fontSize=s; function MouseTextfollow(i) var x; if(i6)x=cx-70+i*10; else x=cx-35+i*10; var y=cy-10+Math.floor(Math.random()*40); w=eval(MouseText+i); with(w.style) left=x.toString()+px; top=y.toString()+px; function MouseTextLocation() cx=window.event.x; cy=window.event.y; document.onmouse

4、move=MouseTextLocation;var MouseText=new Array(7);MouseText1=W; MouseText2=e; MouseText3=l; MouseText4=c; MouseText5=o; MouseText6=m; MouseText7=e;for(i=1;i=7;i+) document.write(+MouseTexti+);MouseTextStart();3 图形围绕鼠标鼠标特效篇-图形跟随鼠标鼠标特效篇-图形跟随鼠标 function MousePicture() layerRef=document.all; styleSwitch

5、=.style; layerName = Picture eval(var curElement=+layerRef+layerName+) eval(layerRef+layerName+styleSwitch+.visibility=hidden) eval(curElement+styleSwitch+.visibility=visible) eval(newleft=document.body.clientWidth-curElement+styleSwitch+.pixelWidth) eval(newtop=document.body.clientHeight-curElement

6、+styleSwitch+.pixelHeight) eval(height=curElement+styleSwitch+.height) eval(width=curElement+styleSwitch+.width) width=parseInt(width) height=parseInt(height) if (event.clientX (document.body.clientWidth - 6 - width) newleft=document.body.clientWidth + document.body.scrollLeft - 6 - width else newle

7、ft=document.body.scrollLeft + event.clientX eval(curElement+styleSwitch+.pixelLeft=newleft) if (event.clientY (document.body.clientHeight - 6 - height) newtop=document.body.clientHeight + document.body.scrollTop - 6 - height else newtop=document.body.scrollTop + event.clientY eval(curElement+styleSw

8、itch+.pixelTop=newtop)document.onmousemove = MousePicture;document.write()document.write()document.write() 4 文本跟随鼠标鼠标特效篇-文本跟随鼠标鼠标特效篇-文本跟随鼠标var x,yvar step=18var index=0var message=鼠标特效篇-文本跟随鼠标!message=message.split()var xpos=new Array()for (i=0;i=message.length-1;i+) xposi=-50 var ypos=new Array()fo

9、r (i=0;i=1; i-) xposi=xposi-1+step; yposi=yposi-1 xpos0=x+step ypos0=y for (i=0; i=1; i-) xposi=xposi-1+step; yposi=yposi-1 xpos0=x+step ypos0=y for (i=0; imessage.length-1; i+) var thisspan = eval(document.span+i); thisspan.left=xposi; thisspan.top=yposi var timer=setTimeout(MouseText(),30)function

10、 MouseScroll(e) x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY index=1for (i=0;i=message.length-1;i+) document.write() document.write(messagei) document.write()if (document.layers) document.captureEvent

11、s(Event.mousemove);document.onmousemove = MouseScroll;.spanstyle color: #ff0033; font-family: 宋体; font-size: 10pt; position: absolute; top: -50px; visibility: visible5 星星跟随鼠标鼠标特效篇-星星跟随鼠标鼠标特效篇-星星跟随鼠标if (!document.layers&!document.all) event=testfunction YY_MouseStar(evnt) if (yyns4) if (evnt.pageX) y

12、y_ml=evnt.pageX; yy_mt=evnt.pageY; else yy_ml=(event.clientX + document.body.scrollLeft); yy_mt=(event.clientY+document.body.scrollTop); if (yy_tracescript) eval(yy_tracescript)function YY_LayerStar(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) if (document.layers)|(document.all)

13、 with (Math) yynextx= eval(yyfnx) with (Math) yynexty= eval(yyfny) yycnt=(yyloop & yycnt=yystep*yybilder)?0:yycnt+yystep; if (document.layers) eval(yydiv+.top=+(yynexty+yytop) eval(yydiv+.left=+(yynextx+yyleft) if (document.all) eval(yydiv=yydiv.replace(/.layers/gi, .all); eval(yydiv+.style.pixelTop

14、=+(yynexty+yytop); eval(yydiv+.style.pixelLeft=+(yynextx+yyleft); argStr=YY_LayerStar(+yyleft+,+yytop+,+yyfnx+,+yyfny+,+yydiv+,+yybilder+,+yyloop+,+yyto+,+yycnt+,+yystep+); if (yycnt=yystep*yybilder)eval(yydiv+.yyto=setTimeout(argStr,yyto); var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml

15、 = 0;document.onmousemove = YY_MouseStar;yy_tracescript = ;if (yyns4) document.captureEvents(Event.mousemove); YY_MouseStar(,document.YY_MouseStar1)YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/40)+0)*150*(sin(10+yycnt/20)+0.3),yy_mt+sin(15*sin(yycnt/34)+0)*150*(sin(10+yycnt/20)+0.3),document.layersyyd0,2

16、002,true,88,7,1);YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/28)+30)*150*(sin(10+yycnt/20)+0.3),yy_mt+sin(15*sin(yycnt/9)+30)*150*(sin(10+yycnt/20)+0.3),document.layersyyd1,2002,true,88,7,1);YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/16)+60)*150*(sin(10+yycnt/20)+0.3),yy_mt+sin(15*sin(yycnt/16)+60)*150*(si

17、n(10+yycnt/20)+0.3),document.layersyyd2,2002,true,88,7,1);YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/7)+90)*150*(sin(10+yycnt/20)+0.3),yy_mt+sin(15*sin(yycnt/44)+90)*150*(sin(10+yycnt/20)+0.3),document.layersyyd3,2002,true,88,7,1);YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/34)+120)*150*(sin(10+yycnt/20)+0

18、.3),yy_mt+sin(15*sin(yycnt/2)+120)*150*(sin(10+yycnt/20)+0.3),document.layersyyd4,2002,true,88,7,1);YY_LayerStar(0,0,yy_ml+cos(15*sin(yycnt/38)+150)*150*(sin(10+yycnt/20)+0.3),yy_mt+sin(15*sin(yycnt/18)+150)*150*(sin(10+yycnt/20)+0.3),document.layersyyd5,2002,true,88,7,1);6 窗口开关鼠标特效篇-窗口开关控制鼠标特效篇-窗口开

19、关控制function OpenWindow() msg=window.open(, Homepage, toolbar=yes, location=yes, directories=yes, status=yes,menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=240, height=270);窗口开关6 激活警告框鼠标特效篇-激活警告框鼠标特效篇-激活警告框激活警告框7 依据位置显示坐标鼠标特效篇-依据位置显示标志鼠标特效篇-依据位置显示标志function MouseOverPicture(Picture

20、Name) PictureName.src = Picture002.jpg function MouseOutPicture(PictureName) PictureName.src = gif1.gif 263 在线 搜 狐 网 新 浪 网 雅 虎 网8 状态栏显示信息鼠标特效篇-状态栏显示信息鼠标特效篇-状态栏显示信息状态栏显示信息9 选择颜色变幻背景鼠标特效篇-选择颜色变换背景鼠标特效篇-选择颜色变换背景index=0;function MouseColor(SelectColor) if ( index = 0 ) document.bgColor=SelectColor; function ChangeColor() if ( index = 0) index = 1; else index = 0; 选择背景的颜色: 9 显示图形鼠标特效篇-显示图形鼠标特效篇-显示图形PictureName1=new Image()PictureName1.src=Picture002.jpgPictureName2=new Image()PictureName2.src=gif1.giffunction ChangePicture(imagename,objectsrc)if (document.images) documen

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论