熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

鼠標旋轉特效

2022-06-13   來源: JSP教程 

  <script language="JavaScript">

<!   var images=;//Put your image name here!! var amount=;       //Number of images here!! var yBase = ; var xBase = ; var step = ; var currStep = ; var Xpos = ; var Ypos = ; var i = ; var j = ; if (documentall) { documentwrite(<div id="ieDiv" style="position:absolute;top:px;left:px">) documentwrite(<div id="c" style="position:relative">); for (n=; n < amount; n++) documentwrite(<img src=" +images+" style="position:absolute;top:px;left:px">) documentwrite(</div>) documentwrite(</div>)  function MsieMouseFollow(){  Xpos = documentbodyscrollLeft+eventx;  Ypos = documentbodyscrollTop+eventy;  }  documentonmousemove = MsieMouseFollow; } else if (documentlayers) { windowcaptureEvents(EventMOUSEMOVE); for (ns=; ns < amount; ns++)  documentwrite("<LAYER NAME=n"+ns+" LEFT= TOP=><IMG SRC="+images+"></LAYER>"); function NsMouseFollow(evnt){  Xpos = evntpageX;  Ypos = evntpageY;  }  windowonMouseMove = NsMouseFollow; } function Swirl(){ if (documentall) {  yBase = windowdocumentbodyoffsetHeight/;  xBase = windowdocumentbodyoffsetWidth/; } else if (documentlayers) {  yBase = windowinnerHeight/;  xBase = windowinnerWidth/; }   if (documentall) {  for (i=;i<ieDivallcalllength;i++)  {   ieDivallcall[i]styletop = Ypos + Mathcos((*Mathsin(currStep/))+i*)*yBase*(Mathsin(+currStep/)+)*Mathcos((currStep + i*)/);   ieDivallcall[i]styleleft = Xpos + Mathsin((*Mathsin(currStep/))+i*)*xBase*(Mathsin(+currStep/)+)*Mathcos((currStep + i*)/);  } } else if (documentlayers) {  for ( j = ; j < ns ; j++ ) // is number of NS layers!  {   var temp="n"+j   documentlayers[temp]top = Ypos + Mathcos((*Mathsin(currStep/))+j*)*yBase*(Mathsin(+currStep/)+)*Mathcos((currStep + j*)/);   documentlayers[temp]left =Xpos + Mathsin((*Mathsin(currStep/))+j*)*xBase*(Mathsin(+currStep/)+)*Mathcos((currStep + j*)/);  } } currStep += step; setTimeout("Swirl()" ); } Swirl(); // > </script>  
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20155.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.