捌玖网络工作室's Archiver

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

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

<style type="text/css">
)~1s!cb$]~ #supertext {8}d1F2p8Ly
position:absolute;;pADq1M ]
left:0;2N1R0T8bH+PG|'D
top:0;rfcjM y;[ y%w
visibility:hide;*rOR2s5^lWW
visibility:hidden;_Y#MH+d$^ `(i
}
!}0y.L,jQm%\3B [ </style>
*j6T/w9@ wx?g,u <script language="JavaScript1.2">gk7B-`'X4m2B+r
<!-- 改变下的字体的大小。颜色-->6?I6i+ht"v)Zpj,P
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>':a1r["t%aA4NL*O
var hidetimer='';
7ZX1KK0d~`$]j <!-- 改变下的弹跳速度-->{eC$y1GI;F#Ljuq
var BallSpeed = 20;U RW;w ~g*ps
var contentWidth;
UJ'hI{X5U0o[ var contentHeight;
'XZhxone var maxBallSpeed = 50;
%B'Tk ~4p-X&a4X7g%i*P
9oQ'wQQ/\P
%k B"r8i,O[ wDv9B var xMax; J,{uU5p5tA
var yMax;
(XbX.f!V6g#X,YE0l var xPos = 0;
ip"? a8q v var yPos = 0;
Ihv^-]I var xDir = 'right';P jX S5F+p^]
var yDir = 'down';L qS$Y3LxI
var superballRunning = true;5g%XTyv k!~
var tempBallSpeed;
3f*O~([3VCS var currentBallSrc; qw4[x-j
var newXDir;?rC TsV
var newYDir;
\5Y;N8jNT;d
?TP6Kn'Z/u function initializeBall() {
0o1Gm[_*s&q    if (document.all) {L c!M0e(H P E
      xMax = document.body.clientWidthNQk}_/y{^
      yMax = document.body.clientHeight
3H ^,TO4Z3C5tuJJr       document.all("supertext").style.visibility = "visible";
o5prl$F/k6ll       contentWidth=supertext.offsetWidth
`3g?-o`:g0H       contentHeight=supertext.offsetHeight5FZ!ZD1S-@,R
      }
*k2s5Y wKk    else if (document.layers) {
$Wa#{*kD&[9c&q       xMax = window.innerWidth;
o0c p,f&n       yMax = window.innerHeight;
0b+m Ux!L5tp"K       contentWidth=document.supertext.document.width
N7h!z)dc2lLs+dd       contentHeight=document.supertext.document.height
BY6ql8\       document.layers["supertext"].visibility = "show";
J*tt(A3NS       }3h.DlQTs4Af
   setTimeout('moveBall()',400);
$j_*y)_K&n    if (hidetimer!='')3R.ot},l+M-@'iAC
   setTimeout("hidetext()",hidetimer)K!]4|0@ h5O
   }
bx%Dr&w$X)n z\SU9_:e6u'r6brH
function moveBall() {
;n nt}Rq }!Q    if (superballRunning == true) {#^8^f-k&Xr6F:c
      calculatePosition();
h$cKD2m       if (document.all) {0]0pa0NK$d|
         document.all("supertext").style.left = xPos + document.body.scrollLeft;5DBkd6?HmcJ
         document.all("supertext").style.top = yPos + document.body.scrollTop;
q4V7p5T(v,NSBI~/m          }3u%sqg1f:{ED0L s
      else if (document.layers) { t'^/Gz*w6`3EN9Yy
         document.layers["supertext"].left = xPos + pageXOffset;
.R%n'H @KJ          document.layers["supertext"].top = yPos + pageYOffset; z%C9z\ ^$R(pJ#N9j
         }
7sJkc9a @Kg       animatetext=setTimeout('moveBall()',20);mG\@9?&]+sv
      }3yD$g|9j9y,v J
   } U|Ax%T l5E*E.{5r']
!G Y/K6O1~#[{o
function calculatePosition() {&nsk`g^(HI
   if (xDir == "right") {
*N,sG1Ec7w h       if (xPos > (xMax - contentWidth - BallSpeed)) {
C[5@_/Xyi          xDir = "left";
0U ` q"i Nv$xC'V          }G%[!m9jqm)u
      }F`e jbw
   else if (xDir == "left") {
)r6B|w)\Y+X.A       if (xPos < (0 + BallSpeed)) {N2UdHc{1D9Hv!vc
         xDir = "right";*Fl/`5N$q(]
         }
4n3KDp6tE-jI2C%K ]       }BU5E/K*C{v}#m
   if (yDir == "down") {U5yr!Kg7\
      if (yPos > (yMax - contentHeight - BallSpeed)) {
,u6T i+\BQ          yDir = "up";
:NqqH:R$cC          }q8V8g8Ng
      }
0p,X{Q4Fu?    else if (yDir == "up") {| i!PD$G.IWd$X
      if (yPos < (0 + BallSpeed)) {
'Dy8ib^#d;T#Na          yDir = "down";g7D{3{Li-V4qbP
         }jjt-Y(^4_'NOm'v
      }
0O|*iln&Jp[    if (xDir == "right") {
Io _ Ip/I {f       xPos = xPos + BallSpeed;
o~ a8G5DzMs\       }
z UUj8\ \;e+q    else if (xDir == "left") {
E bv7V'T?$a1K|E       xPos = xPos - BallSpeed;C:C+r)l ?CH
      }
1S u^0}J G    else {!qQ f.|gV
      xPos = xPos;a&` O n z'h(uO4su
      }
4Lv zL5ABM`$P mmt    if (yDir == "down") {+q'`1MCgiu6D;D
      yPos = yPos + BallSpeed;
{#p e/wIQOw       }
txz7ew }    else if (yDir == "up") {z iNs"oYF
      yPos = yPos - BallSpeed;
&M}Su?       }7cI"AnDN X3V
   else {
]$E#_MQ uU:S       yPos = yPos;
,RAqZe6kAh       }
J6rMl&]aN    }a,Ah0U} A hRaW;Z

Ui3wMM function hidetext(){I~h&gNH GG
if (document.all)` vp3Rf
supertext.style.visibility="hidden"
2}x qv-Z B5L else if (document.layers)2u)MhA4d\5mq$ZL
document.supertext.visibility="hide"r;_R@Do R
clearTimeout(animatetext)
h0F!E.S2?!o/`uYW }u%? Ul5x3R$a U
'IK*f0Q:`#s]
if (document.all||document.layers){
n(i6Bgf(U#j:v6P document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')8~o~G!j+| @q"j&f
window.onload = initializeBall;t1g5b S.^^X
window.onresize = new Function("window.location.reload()");w-Sjmx
}(O!Y,AQ#S _

;JyLL*x(|8S </script>

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


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