码迷,mamicode.com
首页 > Web开发 > 详细

JS特效-飞舞的彩蝶

时间:2014-08-19 10:53:44      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   java   os   io   ar   

  • 一款JS特效-飞舞的彩蝶,哇,是不是好有感觉!还会跟随鼠标移动,鼠标移在哪里,就跟向哪里,纯粹JS实现的效果,没有用到任何的修饰图片,推荐给喜欢网页特效的朋友们。
<html>
<head>
<title>石家庄油漆</title>
</head>
<body><script language="JavaScript">
if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML=<marquee style="border:1px solid black">+text+</marquee>
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"}
else if (document.layers){
document.tooltip2.document.nstip.document.write(<b>+text+</b>)
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"}}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"}}
function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150}
</script>
<script language="JavaScript">
function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2
if ((document.layers)||(document.all)){
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="+(yynexty+yytop));
eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));  }
argStr=YY_Layerfx(+yyleft+,+yytop+,"+yyfnx+","+yyfny+","+yydiv+",+yybilder+,+yyloop+,+yyto+,+yycnt+,+yystep+);
if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");} }}
function YY_Mousetrace(evnt) { 
if (yyns4)
{if (evnt.pageX) {yy_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)}
</script>
<script language="JavaScript">
function PopWin()
{
var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");
}
</script>

<div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow">
<layer name="nstip" width="1000px" bgColor="lightyellow">
</layer>
</div>
<div id="yyd0"
style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c; layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd1"
style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574; layer-background-color: #708574; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd2"
style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf; layer-background-color: #379bbf; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd3"
style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c; layer-background-color: #25184c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd4"
style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-index:1; background-color: #31bd3c; layer-background-color: #31bd3c; border: 1px none #000000; clip: rect(0 3 3 0)"></div><div
id="yyd5"
style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-index:1; background-color: #c11efd; layer-background-color: #c11efd; border: 1px none #000000; clip: rect(0 3 3 0)"></div><script>
var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml = 0;
document.onmousemove = YY_Mousetrace;
yy_tracescript = ‘‘;
if (yyns4){ document.captureEvents(Event.mousemove);
  YY_Mousetrace(‘‘,,document.YY_Mousetrace1)}
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/39.83007847812662))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/34.224861639800686))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd0\‘],2000,true,80,0,1);
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/27.66510707209673))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/9.240632767417667))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd1\‘],2000,true,80,0,1);
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/16.45318944579641))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/16.0564452288292))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd2\‘],2000,true,80,0,1);
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/6.95348954836835))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/44.13697049887155))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd3\‘],2000,true,80,0,1);
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/33.90077294583733))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/2.2378828869411587))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd4\‘],2000,true,80,0,1);
YY_Layerfx(0,0,yy_ml+cos((15*sin(yycnt/37.858312521039835))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),yy_mt+sin((15*sin(yycnt/18.083839795990098))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20),document.layers[\‘yyd5\‘],2000,true,80,0,1);
</script>
<p align="center" style="line-height: 20px"><font color="#666666"><span
style="font-size: 9pt"><font size="5" color="#FF6699">哇,是不是好有感觉!</font><br>
  </span></font></p>
<hr size="1" noshade width="100%" color="red">
<p align="center" style="line-height: 20px">
<font face="Arial, Helvetica, sans-serif" color="#666666"></font>  
</body>
</html>

 

JS特效-飞舞的彩蝶,布布扣,bubuko.com

JS特效-飞舞的彩蝶

标签:style   blog   http   color   java   os   io   ar   

原文地址:http://www.cnblogs.com/youtianxia/p/3921397.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!