打印本文 打印本文 关闭窗口 关闭窗口
网页特效--在页面上蠕动的怪圈
作者:武汉SEO闵涛  文章来源:敏韬网  点击数632  更新时间:2009/4/23 11:32:50  文章录入:mintao  责任编辑:mintao

      <HTML><HEAD><META http-equiv='Content-Type' content='text/html; charset=gb2312'><TITLE>一个在页面上蠕动的怪圈,可以变换一下颜色,效果会好许多</TITLE></HEAD><BODY bgcolor=#000000><script language=JavaScript>if (document.all){with (document){write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')str = '<div style="position:relative;width:XXpx;height:XXpx;background:#ffffff;font-size:XXpx;visibility:visible"></div>'re = /XX/g;// 创建正则表达式模式?str1=str.replace(re,"1")str2=str.replace(re,"2")str3=str.replace(re,"3")for (j=0;j<2;j++){ for (i=0;i<14;i++) write(str1) for (i=0;i<9;i++) write(str2)}write(str3)write('</div>')}}if (document.layers)var yBase = 10;var xBase = 10;var step = 0.5;var currStep = 0;var Xpos = 520;var Ypos = 250;if (document.all){  function MoveHandler(){  Xpos = document.body.scrollLeft+event.x;  Ypos = document.body.scrollTop+event.y;  }                ;}else if (document.layers){  function xMoveHandler(evnt){  Xpos = evnt.pageX;  Ypos = evnt.pageY;  }  window.onMouseMove = xMoveHandler;}function animateLogo() {if (document.all){ yBase = window.document.body.offsetHeight/6; xBase = window.document.body.offsetWidth/6;}else if (document.layers){ yBase = window.innerHeight/8; xBase = window.innerWidth/8;}if (document.all){ for ( i = 0 ; i < starsDiv.all.length ; i++ ) {  starsDiv.all[i].style.top = Ypos + yBase*Math.sin((currStep + i*4)/12)*Math.cos(400+currStep/200); starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(currStep/200); }}else if (document.layers){ for ( j = 0 ; j < 14 ; j++ ) //number of NS layers! {  var templayer="a"+j  document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(400+currStep/200);  document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(currStep/200); }}currStep+= step;setTimeout("animateLogo()", 10);}animateLogo();</script></BODY></HTML>

打印本文 打印本文 关闭窗口 关闭窗口