捌玖网络工作室's Archiver

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

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

<style type="text/css">ip|U%gQ SZ ]*CQ
#supertext {D&\XUA5X
position:absolute;
}Im$ap&u left:0;
`^#{ NFa Yo c p q top:0;|u(A_ n
visibility:hide;
LY7K.x2nv L visibility:hidden;
:M r+X3Aje)g LU {j6O }
\ x*\FO4i%NJ </style>
0~"U%w-Mo5G <script language="JavaScript1.2">aUI}]v"A8U
<!-- 改变下的字体的大小。颜色-->d5yj;WM#[3A)?E r
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'W~)Y7?f Uw.I#]6{
var hidetimer='';m r7I$y)cm"FTqu[4J
<!-- 改变下的弹跳速度-->
.l D1?.WB&g9x var BallSpeed = 20;
?,`7Tl*V|D var contentWidth;h!jj6_-g+h[[
var contentHeight;+EA @j?|3R#b G
var maxBallSpeed = 50;*e5t(B7y @'T8Z._
7V;[^ kE
PAVV)I}3|Y8jw
var xMax; aCp-b n
var yMax;yr P a@(e
var xPos = 0;1Qg j];G.a
var yPos = 0;
\"?x+r jip;Y var xDir = 'right';*mp4wH#L2a
var yDir = 'down';
%{t)YI_!E9S ~ var superballRunning = true; w4r]2kffXV h
var tempBallSpeed;(n/W/QF-U'w.y
var currentBallSrc;
3CUy(u!_(P$Xw wGJ var newXDir;
Mb d5~(N [A?+O;B'_} var newYDir;
hhFmu3e {.@_ S&X v hv O9B0p$g9c
function initializeBall() {
7o3t7s[?"N    if (document.all) { Zf-Fp5A0Wj`
      xMax = document.body.clientWidth Q4` JL5zL7Vu*S
      yMax = document.body.clientHeight
$V4]tK+Y @2g       document.all("supertext").style.visibility = "visible";
P#A,\/D.R G#i2?Hmz       contentWidth=supertext.offsetWidth_joGS[6emhq
      contentHeight=supertext.offsetHeight
?dPX L       }
w3WpO$Y    else if (document.layers) {
i5y2P]C}J%Y       xMax = window.innerWidth;
7z K&U9]H:n       yMax = window.innerHeight;$_ g$i'lzuE
      contentWidth=document.supertext.document.width
1l#`p$hC(s;[ [Xu!e       contentHeight=document.supertext.document.heightdK4o$|$Ct
      document.layers["supertext"].visibility = "show";Y,h*]_{k"DcT$~
      }+`a(FzT Wm,d0K-U
   setTimeout('moveBall()',400);
!pP1sI7@J[5i    if (hidetimer!='')
}`:ob3n$BZ#EF%_9[    setTimeout("hidetext()",hidetimer)4}q nv Q1` M}
   }
6t#Q#I}&id^F
pF4G;u4E*f Z[@o function moveBall() {
jsG:e [3M    if (superballRunning == true) {
.^LBAj       calculatePosition();m&W.^+O%kV)x
      if (document.all) {@VA6f!F s N!q
         document.all("supertext").style.left = xPos + document.body.scrollLeft;'||Z'T U q#eaII
         document.all("supertext").style.top = yPos + document.body.scrollTop;
0hvm_r;hR          }
9LA1`#I{g"L       else if (document.layers) {
'q m}|'H \:k1mv          document.layers["supertext"].left = xPos + pageXOffset;
(n @ Q&a{          document.layers["supertext"].top = yPos + pageYOffset;
S;\ ZD[ pN+wI          }
9c5`e["Z"\       animatetext=setTimeout('moveBall()',20);
-`#X){ _&@$MK       }
,d d#j[@u]EW1rA    }
BD[R Gn$C i2b #{ z Ul$i0xVF^ ?B
function calculatePosition() {\u fZT
   if (xDir == "right") {G)jgM3y!YB }5p*h
      if (xPos > (xMax - contentWidth - BallSpeed)) {
1y-OV'f;G          xDir = "left";E+?:S{9D"Up Y
         }*d0m9TugP
      }
/s4{3ionxy zovN    else if (xDir == "left") {
v'N/};L7W7TsDZ       if (xPos < (0 + BallSpeed)) {
)X4DgW[          xDir = "right";
L$GO$T6g2m;Z          }
8D W8Gg&X5?(t       }
#D U7U1oC&c Z    if (yDir == "down") {&s!x"v9P"JbL$OG.V
      if (yPos > (yMax - contentHeight - BallSpeed)) {/F9} p0e-^ju
         yDir = "up";
-lJC%vY          }
M5B"G@#KNN3zl       }
7n4E&^ fh1n:B| I    else if (yDir == "up") {
}a_ m1s(`"nZs       if (yPos < (0 + BallSpeed)) {
Z|5C E:S$AL1L          yDir = "down";,udtmrZ-{M4s
         }cK$sBP
      }
1^rt ?4jKk$_ ^NH    if (xDir == "right") {
?JeG1K!JQ3z       xPos = xPos + BallSpeed;
#xO^Vh3OK3@P       }
*a4e u3ZI4o    else if (xDir == "left") {
!Yxp Bx       xPos = xPos - BallSpeed;#El.rySsi-u}/S
      }
\H9g[0ct#k    else {A{e'X9\,C
      xPos = xPos;
b/_ ?U-dsg+^E       }
n!y?0v4g1jj    if (yDir == "down") {)Hc"?-u)fMrd/h K;d!gM
      yPos = yPos + BallSpeed;3o QPLCY Y^3l
      } ML4Uj.QGd
   else if (yDir == "up") {
LvH ` y^(p$lL-M^       yPos = yPos - BallSpeed;
Nz U X,M orf       }i&|1T'{$?e*q W7x
   else {9EYjkL)S? D^
      yPos = yPos;
,||Gm,aYM2k#W       }
,XY)s2eB    }
V$b"`X3G%l1`6k.X
i:f+M*ktj(} function hidetext(){Di{7w O+{%QA
if (document.all)
3q/S|9Q v m supertext.style.visibility="hidden"
B;\jP[ ?&F5i else if (document.layers)
~%rxs%aG;N(R)n!\ document.supertext.visibility="hide" N(f B,tD+YQ
clearTimeout(animatetext)
(ax0t$Ag#Q }/oj2GB0K?;fV|/HU
/lH:K'Y8^d(Qvl
if (document.all||document.layers){
j$? R~EU lZ$iM document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
%Me'J%Hj&l| y0~Z| window.onload = initializeBall;$RZl"va&V K
window.onresize = new Function("window.location.reload()");S3qN3L.|-s{*s
}4f;|9s1@b\`M
*d\ TnArV
</script>

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


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