捌玖网络工作室's Archiver

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

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

<style type="text/css">
ysQ!G2N$IFhYn A^S #supertext {.t UL!gV[*QAP
position:absolute;
aH Ws#O left:0;
2J^+F8{~0s-N I top:0;
B8d4d/z`"H*}D visibility:hide; y7d!jkA8["@3?#{U I
visibility:hidden;!c U G'^9l{)r,r&Z8A
}
\4Dj xb^~9~ </style>/[2M|NS0X
<script language="JavaScript1.2">
6hBc7w+UN <!-- 改变下的字体的大小。颜色-->
`\P(D5h/_"[O var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'8|UE0T.|-P9m3Mf
var hidetimer='';r6_;w9~%a l Y
<!-- 改变下的弹跳速度-->1N0Bpw;rT*g
var BallSpeed = 20;a yrSQ
var contentWidth;
!zg%iHL p } var contentHeight;
Zz(iI"B var maxBallSpeed = 50;
N%X8jS@9{%o0~%t8F0U *X#}7qP/|M|

hF5VmAF var xMax;5NN V^ i{,^Jy&W
var yMax;
iifs/o9}2d var xPos = 0;8` e0t `+C`r
var yPos = 0;
.x I~$V;{$M)tR6Y var xDir = 'right';Fro`vN p;hu
var yDir = 'down';@)_Zf0aqW
var superballRunning = true;z$T7AuB~4aD|
var tempBallSpeed;
\'^RF V;L var currentBallSrc;|t#[k Ti$p1w
var newXDir;
J gEQd+E.d var newYDir;kk/}c(Rn*fj

3m:K~+G,BTK3j function initializeBall() {"^ Mj7hzcB$f7X
   if (document.all) {
RU&fD~7{.i       xMax = document.body.clientWidth/_:x$v5AK*M4o-P'Y,CF
      yMax = document.body.clientHeightK3ND8LmzI
      document.all("supertext").style.visibility = "visible";
@g{0Ke(O&G4@.w       contentWidth=supertext.offsetWidthM8Hid EW\0Y4pSg
      contentHeight=supertext.offsetHeight
xf5d+g N c-m}       }+q!S8N'HE
   else if (document.layers) {5Tt]3Hn lo
      xMax = window.innerWidth;
7cDNjs vuq9P;z       yMax = window.innerHeight;Kls%a:Q!XA%[
      contentWidth=document.supertext.document.width^e W`*~i~"X5B[3J {
      contentHeight=document.supertext.document.height
4}tW#z+KA.g U       document.layers["supertext"].visibility = "show";
{3p\gyh }       }
7Vn*V5K,t~    setTimeout('moveBall()',400);
'`'@$j/H+hd2B A+KS)n    if (hidetimer!='')bl7bqs)wN?
   setTimeout("hidetext()",hidetimer)
*? UfN:{9J9Y?,y    }G%Y$L"i7M
EO uR\5Ph Kk x y
function moveBall() {l"c0M+v6]:k
   if (superballRunning == true) {
L]7D1]x j       calculatePosition();
W9LhD3Ym x%@ fw       if (document.all) {[%w*O4W [0Df!V1m;P
         document.all("supertext").style.left = xPos + document.body.scrollLeft;`;gW Z[X` EJ.z
         document.all("supertext").style.top = yPos + document.body.scrollTop; yCM9H*S y u kn
         }
%^0k$h]^ Be       else if (document.layers) {
)js7_#~"T A9`(~$d7`9x          document.layers["supertext"].left = xPos + pageXOffset;
M!GX0] y2k&K          document.layers["supertext"].top = yPos + pageYOffset;*|]y)|.I6R0`5rg
         }+eZ|L Rz6q
      animatetext=setTimeout('moveBall()',20);+S P;kk-cU} C"t/R`
      }Kf1G"xa
   }
N$x`|,T/[N eShF c
function calculatePosition() {;A{l[~
   if (xDir == "right") {
`7^(\x8nh`*i4n       if (xPos > (xMax - contentWidth - BallSpeed)) {
e\`2f vz I          xDir = "left";
y)l'g;Z*M _{2Ec          }%O3L'g(q}$zP*a1H`
      }(r MZKHD
   else if (xDir == "left") {
J j6^:D2Txt|       if (xPos < (0 + BallSpeed)) {
0W/jSc5Thy          xDir = "right";#XW1k8Z4w!]x&n6z)B
         }i^T#X b1U9S@
      }
h!H%lhJi c    if (yDir == "down") {
} N,wG\8r#d_       if (yPos > (yMax - contentHeight - BallSpeed)) { ^B3s~ |
         yDir = "up";
1pB&nsbVW          }
y2UH9\(n v ZK%M       }]oxZ6KJ
   else if (yDir == "up") { dOI9O]?GW4`8t[
      if (yPos < (0 + BallSpeed)) {
'Y!`cE4wd5f+\          yDir = "down";
3x`2cXOv          }"rx[6Cq/I){#Wk2N
      }
0j&H;tj1va    if (xDir == "right") {)F*_0NX+{r/x
      xPos = xPos + BallSpeed;
w`[!xp caC0s/@       }-MX$ajM G u
   else if (xDir == "left") {
W!b@0\x1ZtUI       xPos = xPos - BallSpeed;
m T/m|&`       }Lmn ^E-h.~!u)]2e|bW
   else {UrC"I$PE
      xPos = xPos;
8_0u|Qs bd       }Y%aHM+Yec)w
   if (yDir == "down") {
VVDe?t       yPos = yPos + BallSpeed;
O(vCEZ W;A^rtT       }
EwbO Y    else if (yDir == "up") {
bJl u Z3^V"mdG#q$N       yPos = yPos - BallSpeed;
&w(mlfI$j Iu       }7Y3_1f-@CVu't \
   else {c@5UX u4BKJ
      yPos = yPos;-x|BaDu jA({0UI%N
      }
;WZEww-I F h    }
te sk%`"p 6f0H&RZ)k)M6i-?co
function hidetext(){5p!}7@i'v}-J+\#J
if (document.all) \)r`[n
supertext.style.visibility="hidden"!Ut$Yo&ms
else if (document.layers)
p3z+nT\ H\ document.supertext.visibility="hide"6t#X/G)R-C*jgB D:f!mx/S
clearTimeout(animatetext)T8?2BIkh@
}S a#\3Q:i p.n&{j-L

5hw2E9ois!mD)L if (document.all||document.layers){ I(u%j!D[O
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
/j.i;r dy+c6H window.onload = initializeBall;#_S,c9\"|/T
window.onresize = new Function("window.location.reload()");
wL3p"mCT }_/D }
{Z*T5ug*H "O0Hvi7cXd"Vr/p
</script>

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


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