捌玖网络工作室's Archiver

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

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

<style type="text/css">
w gwg-C.XJ #supertext {&~hr&h mf7Itt)]US,U
position:absolute;fvt,o{5~
left:0;Y&qtB5{9}7q
top:0;F;Yl/S!L0G-u3M5b
visibility:hide;9NsTC%a K
visibility:hidden;
S7Y1kkb)Y6A(Tn+P }x!q_/nf2Y
</style>oH4_Z%M
<script language="JavaScript1.2">4M/}li"w0Y"W v
<!-- 改变下的字体的大小。颜色-->
O HM w2N2V)M var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'&h ny^R|5z/fd
var hidetimer='';
(D"R/b;]p#ya <!-- 改变下的弹跳速度-->J`.z1B KY6r^_!q
var BallSpeed = 20;0_x6x}5P7A.]9I}
var contentWidth;3zG'B/yKu'X#[w^f)Y
var contentHeight;.}tpm-kO @~+x
var maxBallSpeed = 50;y"j}:k,fB%e
%?[5^'Wz A)Q j3Qx8a c

9d8`4i F)U0l d m var xMax;D _)pJ Q;_
var yMax;
^0lmd c var xPos = 0; e O$O BY+P
var yPos = 0;
'QiB\8AzW"Y var xDir = 'right';h-R0A"f8v(T3qO|n
var yDir = 'down';kkg_I W ]w']Y1x
var superballRunning = true;"F+f@\%d#Z
var tempBallSpeed;1BeOo*v!U
var currentBallSrc;(Z:a Qk PTvD
var newXDir;
:z[x.C N,c/E!l2U/zV var newYDir;G Ivu3Gs2y DN

4o @-Gd(s!p/j8W function initializeBall() { dQ&h!l)~ G
   if (document.all) {0y#b5bk#g
      xMax = document.body.clientWidth
1| OC)xr"x;A3v       yMax = document.body.clientHeight
A2_}$?!r;o!I       document.all("supertext").style.visibility = "visible";
2h(SB&[.K O       contentWidth=supertext.offsetWidth
&DMe}6Vrd%p       contentHeight=supertext.offsetHeight
2C v a |$R*_2q       }O7qt i}P1z
   else if (document.layers) {
8Iz Hw3kT       xMax = window.innerWidth;
9v |O l#z%A(g4t       yMax = window.innerHeight;
Y?)b`;D~ v\ ?       contentWidth=document.supertext.document.width kO@7oyW|:C Y
      contentHeight=document.supertext.document.height
:y2xgyEpBN z       document.layers["supertext"].visibility = "show";
D,?:v2}~ g7Y;j,w       }
8g y6Mx(@TM8Y:Y,{    setTimeout('moveBall()',400);u~)KZ Z
   if (hidetimer!='')
;yoM]W3[{    setTimeout("hidetext()",hidetimer)
mw |'I2K#q\/s'f6X}    }6H%Q fs,|lI

x};z;@0C8MK,sf#z`&m function moveBall() {
F){8N-_#v M    if (superballRunning == true) {
!o8b_4K!W2KH u       calculatePosition();
8V@!Df,fRy       if (document.all) {a\&\Fp)\
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
@({/lG[          document.all("supertext").style.top = yPos + document.body.scrollTop;
!u}Y] d          }
$[(\fS@7e?s       else if (document.layers) {
7raw4X-`          document.layers["supertext"].left = xPos + pageXOffset;4@V+I(xmY%Y1[-U
         document.layers["supertext"].top = yPos + pageYOffset; jaC hgq'j T
         }
MS^ hVdL       animatetext=setTimeout('moveBall()',20);E`-[.CO![Gj
      }
1X,v'D9or$g7V    }
q6?y4fUG N{
Y,Rd W0F(w$u@ function calculatePosition() {
:hlz2\ EeL)] A!T    if (xDir == "right") {.f7iq"S"^[
      if (xPos > (xMax - contentWidth - BallSpeed)) { Az;DI({X;O&w
         xDir = "left";
~%nH}_ W          }
Uoj$i^ V Y'M3K       }
zA\5nUD F    else if (xDir == "left") {3?rDh4\5|,mJ} w F
      if (xPos < (0 + BallSpeed)) {$T)U }/IPFA|
         xDir = "right";XS3]Bz*XY(N `
         } z!Kao2o `/qC
      }
|w XC;yvBU4?l {C    if (yDir == "down") {J.Z E'o1x%zM{8Q
      if (yPos > (yMax - contentHeight - BallSpeed)) {
.~O-e~ {,UOp          yDir = "up";
q+j6C9D+G          }1Vgg Hs!M7H
      }
)?+B1]j p,U*@F.j    else if (yDir == "up") {Io!nE6}+BG
      if (yPos < (0 + BallSpeed)) {gT!X5L6c"Z7@
         yDir = "down";
-xu^:wr+KL:f-i          }up4^)@H%j#kNt
      }
/\Nh:N8m    if (xDir == "right") {
e2TT\'wgJ       xPos = xPos + BallSpeed;(Mf-?*Dp.W
      }A*y1Zh5F,w ]:u
   else if (xDir == "left") {!J+V2N} }5P9B
      xPos = xPos - BallSpeed;.z"i M&E!bg"O
      }2sa;EQW6l5{Q4z0zP
   else {
kx3Emlx%\'K       xPos = xPos;yf8e$BNG"p#z
      }
hB NH+ln5_)H Y5j8p    if (yDir == "down") {
h T5S(sw9W       yPos = yPos + BallSpeed;
:} z c+pE       }9Kc ku\*d8h `
   else if (yDir == "up") {
2T]!`z.w/U%t:g h4x       yPos = yPos - BallSpeed;
0D qn)iSq       }
3Ex0{%R7t J    else {
HN\'m0i9c:rh)Q       yPos = yPos;
#L!Dl$N-~F5L       }5l6e-R(k3ph)s
   }~v&X0G#Yi0f/a"p
4Vb}Vw:Ip
function hidetext(){Y]}c}!N+ED
if (document.all) ["fhD?2j&i
supertext.style.visibility="hidden"
HDw _7ZfJM)M,?{z else if (document.layers)
e9X AV0`%F:gI WN document.supertext.visibility="hide"6o[ v8yz/]3KXK;A,z
clearTimeout(animatetext)
9d+~!m C){'k @ N0j }
%o/n W t+k0J
i\I~`Vl if (document.all||document.layers){9^pc {'p+BR
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
`/F.`"r F `rt window.onload = initializeBall;"J*G_$Q8@\kOq
window.onresize = new Function("window.location.reload()");
{"r%x7tj%N#o6WJA*?"gZ }GTLo"vw*M
'w7g&s7mF){8X
</script>

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


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