捌玖网络工作室's Archiver

zw2004 发表于 2008-1-21 20:55

网页之不断弹射的文字-特效

<style type="text/css">
U#^lc,~L/g #supertext {$O?&Q0ZM5Y G
position:absolute;amMtk u7y
left:0;
0K9A,w[RYS3DY top:0;-Y V| rh.C#Myf
visibility:hide;sfsWT H*r
visibility:hidden;
8Y)Jg,Ng)_+^v5E }}]4k;\4t"Sy
</style>
;tN2U i9EF <script language="JavaScript1.2">CxFaE T&[
<!-- 改变下的字体的大小。颜色-->
6C8\(M$viQ b3G var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
8vfc!n9d var hidetimer='';
*r0`+i&E;T+f4te!l1[ <!-- 改变下的弹跳速度-->
QeB,^-\Z var BallSpeed = 20;
e\&D%T[']&v var contentWidth;
`eJ&A@V var contentHeight;
4x(wjR|` var maxBallSpeed = 50;A,I.S8R\5@"Y`z
@lK6A,d4E8hz h~
c+}j]c"F&G q4Dx
var xMax;$en3c}3j4U6[
var yMax;
Ha @7HJ&].|K var xPos = 0;
T+MF` u*F$O+W var yPos = 0;
U @I7Gt:L5?7K(s.D&zV var xDir = 'right';
)X0O`u QC var yDir = 'down';
Mc @mj4z o[ var superballRunning = true;3^9[c&?dWt-`ke:c f
var tempBallSpeed;
sn)i,v.{:hC var currentBallSrc; yy QrYtO
var newXDir;"l&|#b$q8m
var newYDir;
S'LK&zL2`#}9uv
$@,l7H7_ z CG*fo function initializeBall() {,K8IL m AK#T6[*j
   if (document.all) { \0P-y/VZ
      xMax = document.body.clientWidth4GJ @B4i A(Q
      yMax = document.body.clientHeight
X&`-b Yc.|e;X       document.all("supertext").style.visibility = "visible";
2~(xSXDvwv       contentWidth=supertext.offsetWidth
i]BC7g       contentHeight=supertext.offsetHeight BI @$WkjYo
      }
1\~RXQL8T    else if (document.layers) {{vP.zna n_^
      xMax = window.innerWidth;
` H:ZBSa       yMax = window.innerHeight;0Qn$Z6@&^,eJ{
      contentWidth=document.supertext.document.width
f{-O*z0B E j|G       contentHeight=document.supertext.document.height;e4i.Z3iFVw
      document.layers["supertext"].visibility = "show";
$} JI6j N] D       }
"^J7gi hktX/QI!I    setTimeout('moveBall()',400);
Z5k6|!y|wy6fq DBd    if (hidetimer!='')+ngzLQA
   setTimeout("hidetext()",hidetimer)
m c+Q [y9f |    }3MH#Qv |
c.TZp,I&|f o,j
function moveBall() {T-P5U)u5N"J:J v$w:JV
   if (superballRunning == true) { tbCFlY,Y
      calculatePosition();I6Da|bj]l
      if (document.all) {
O.G2a i q|_:B2z          document.all("supertext").style.left = xPos + document.body.scrollLeft;CF?k-{4R
         document.all("supertext").style.top = yPos + document.body.scrollTop;\l%{Z,~[m%U*h)R
         } `p$zZ[~#o2n/J
      else if (document.layers) {KM+p v"q_M|
         document.layers["supertext"].left = xPos + pageXOffset;~ U:?!{M%P
         document.layers["supertext"].top = yPos + pageYOffset;
{l*](g6AY Irl          }
9w:NT,J8f.^:f{       animatetext=setTimeout('moveBall()',20);
t)V O*VC       }
c&P%@iP JB ~S$G9[ d    }VE*A9A9QMd'jT
k%lz$FTyk
function calculatePosition() {
#kq&R|@    if (xDir == "right") {
;b i A7tsu2B       if (xPos > (xMax - contentWidth - BallSpeed)) {'hcm i|
         xDir = "left";3[#f(|@nt4a#\g]8p
         }
GX!pqV'Ez&qS BJ       }T| Fy}2Xw.KU
   else if (xDir == "left") {
-?a7A_K5i2Wk       if (xPos < (0 + BallSpeed)) {
G'L+zHQZ}          xDir = "right";
Gs\f&O1O          }8b _hEKR6|A
      }v&{ t;L&yO&V
   if (yDir == "down") {TEDkZ;l%Tm'Ei
      if (yPos > (yMax - contentHeight - BallSpeed)) {
(fuQH8J iY[          yDir = "up";
G/GiY!B^ E#GJ          }
?OR8d Kw nQ y!AB       }j4Rt/O4F2|E
   else if (yDir == "up") {
og8W&e#V Kr7Zw       if (yPos < (0 + BallSpeed)) {
-DI8@p9]X          yDir = "down"; wciZ,Zm.]5p4S
         }.s#I|7Mc|t0ka%HV
      }
D3m3y5\G&`    if (xDir == "right") {
#R8u#Dx+}:o6abD       xPos = xPos + BallSpeed;
p7S'ELYMR6[       }3lB\1YR
   else if (xDir == "left") {(FnER}1g;E/G
      xPos = xPos - BallSpeed;~6A5o6hU1w1j
      }
TFPvL-R-H    else {K5^P0M:|/e3l%o8ml
      xPos = xPos;
6UCJ"^/wF       }A+S$XP#B+V6_l3_L T m
   if (yDir == "down") {(y8wMKe"Lm,l
      yPos = yPos + BallSpeed;
LA? wx0B d8o       } Aw:[.tF:L~
   else if (yDir == "up") { O J6g\6D-Q
      yPos = yPos - BallSpeed;'kx,jT8rh7_o Q6T
      }
?]#PP1`~@    else {
c4paJ K       yPos = yPos;T#bR"Z8Q#JMS
      }/w8a{Ou0o }K
   }
*OC'j4] yr`'W:SAV
_KM,YE function hidetext(){$b;Q(J1SH)U
if (document.all)
AoT+G j supertext.style.visibility="hidden"
0e;j9m.P6~ else if (document.layers)
8F!_)cOr document.supertext.visibility="hide":Y&z C;]#?V YY|
clearTimeout(animatetext)$TK7n{lx(AI;?
}YjM2[ I6c
;{7C.q:A!U)L
if (document.all||document.layers){
D'F6ID"i:V9j document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
kfC7K e zaq window.onload = initializeBall;X V5HCO.q.{ f
window.onresize = new Function("window.location.reload()");
fd:GAg{ }.L G fW.K"j)CU
W8V8_K!}Y4T/^q
</script>

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.