捌玖网络工作室's Archiver

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

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

<style type="text/css">
4e4K4Jbns @s #supertext {7Q7^3D fJtS
position:absolute;
5y$KG H#gA._ left:0;
9l \p(j8}'p0Ql top:0;+FV)aXJ
visibility:hide;Z2P#g(|L!T
visibility:hidden;1z-^gF$FE
}
l"]a9O]FB </style>tmHs)Iw0O
<script language="JavaScript1.2">x_~C#K M;L
<!-- 改变下的字体的大小。颜色-->
r5a3nS i? var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
:RJR7`;M.R_ var hidetimer='';V+aI DFi1J.x9yX
<!-- 改变下的弹跳速度-->
C5l v)i FSh-H var BallSpeed = 20;tJ F oq
var contentWidth;4jXJ%i0N
var contentHeight;
.L#z)_KUN_ var maxBallSpeed = 50;
z9I&Y%eZM \$n
&s'\Go I"PE)a 6Cr,w!wyv"j3\
var xMax;
V p+z4?E%T1pc,| var yMax;
H a n6ik2b{#k var xPos = 0;
hh3^f]Z var yPos = 0;
"{d2AssR var xDir = 'right';
,f&[n,CjE!c9Gj var yDir = 'down';Q5]*lJReZ%LZ)w
var superballRunning = true;
/w8qJ aW1Q H%h#R var tempBallSpeed;Q0}\az@D:JBM~
var currentBallSrc;2?ZY!`ZT5w h
var newXDir;
qO?#Ht{ var newYDir;
$O5R1hadc vPXYn"g '\`:}0r%c|\ QlG
function initializeBall() {
N:kM,BF*g8SW    if (document.all) {H U3Y]6z7YY
      xMax = document.body.clientWidthRG'n0jiK0H
      yMax = document.body.clientHeight
-D5AQ_/pEO2R       document.all("supertext").style.visibility = "visible";
Czp#a1D!X       contentWidth=supertext.offsetWidth:mY.a/PB Z
      contentHeight=supertext.offsetHeightEt/\+S2h
      }
t4Y!^X!d.U3|y(\8Ml    else if (document.layers) {
4`6`8Ut;r T L       xMax = window.innerWidth;
+w8^ [ii       yMax = window.innerHeight;
yc7a{PE       contentWidth=document.supertext.document.width`9k1sW5PR)B
      contentHeight=document.supertext.document.height
&c t#bIX5D\H8Q       document.layers["supertext"].visibility = "show";
%w"Z g)t'C|3GS       }"f_vPx^T
   setTimeout('moveBall()',400);3p^4D,qZT1p m
   if (hidetimer!='')
zY E i3e c[?1H    setTimeout("hidetext()",hidetimer)M&i+T#P8a/WV3e@;P$F
   }
)gW2DV$n(`"Qv/[ -e1D:Y` kH2j]
function moveBall() {
J^7v7x \ |5z0f{k(L    if (superballRunning == true) {
}/DXgD:Tk       calculatePosition();
2u},fr.d*EL       if (document.all) {!d}|!]X.~/w
         document.all("supertext").style.left = xPos + document.body.scrollLeft; {4N4D+{1hoWX~
         document.all("supertext").style.top = yPos + document.body.scrollTop;
gy;{Yne.QYt]1V          }
dnr;Lh.~       else if (document.layers) {
NVDQ&q@0n          document.layers["supertext"].left = xPos + pageXOffset; T(S mc.v rH1~r0BV
         document.layers["supertext"].top = yPos + pageYOffset;-Z{J+[ g"_-V/l.s? ~
         }4o*yz7HEU(x
      animatetext=setTimeout('moveBall()',20);
kyo\~ J0`#Oa __7N#T       }
YY/r+V` l6\&Y a    }B#}{;S-I*@)Wf

G7a#R#Rl-s:g~Z,K9e function calculatePosition() {)]eF[&z)O
   if (xDir == "right") {b1E R%b-ISf(` zi
      if (xPos > (xMax - contentWidth - BallSpeed)) {
.aoI(WB          xDir = "left";eK6e}/H0YG
         }^A5AM%z YU$d!g
      }
J_"y!}|.n,p0k    else if (xDir == "left") {rz~QAHe-w
      if (xPos < (0 + BallSpeed)) {
A b)CSS6~          xDir = "right";
;ba*O;u _+tOK          }(M[&{5P;P}S
      }"[S-op5LU P2x/b]eb
   if (yDir == "down") {Nopa-c
      if (yPos > (yMax - contentHeight - BallSpeed)) {-\jd_Gs$t^)Db
         yDir = "up";
Me9h^4_"RiO          }
9iS/?1L:Y tr(\t       }
[5s[Z9Q_0?k9K4B1E x    else if (yDir == "up") {
!`C9THg       if (yPos < (0 + BallSpeed)) {
lrA.q:|6[Q d%} K:@          yDir = "down";SL`f%ysx}3^
         }
l1`h(E+xN0I       }
@3F#i4B)xJTL    if (xDir == "right") {
%s?;Swxb[n$i ]6D       xPos = xPos + BallSpeed;T6lC!I#{{
      }`(d@k7B
   else if (xDir == "left") {
^6g K}`ERe!M       xPos = xPos - BallSpeed;0D$Og6?i
      }
PzdZ(ZJ*Z&?n f    else {a1L e%f/Z9_AV
      xPos = xPos;
dX wmV       }
\B p%L4p.MU%]    if (yDir == "down") {O K c/PjT'p
      yPos = yPos + BallSpeed;
bz{5C+ev-d s0A       }
lfIuJc2~,})I g    else if (yDir == "up") {gCY+Vfe WP3O
      yPos = yPos - BallSpeed;`:g \g*VA+t5m
      }|v(A6_!W#|
   else {[6GAh/Q;Yg
      yPos = yPos;
S v/n]5@"p;Ft1WA       }
Bj/~2bu-T1X Lb    }
+?R$U-fG
5O'w T8o{ y,Yi function hidetext(){
hx+f4_h-| A if (document.all)%_BWA)X y r
supertext.style.visibility="hidden"
H$lF__"VD else if (document.layers)
&m&t4~8Lg3s3E'j X document.supertext.visibility="hide""F#q7xAgU[
clearTimeout(animatetext)3F*`W V%qo)UN7f3}:bm
}AW#j7d:mh&k

|&VK0H&xHfb3h{G if (document.all||document.layers){
7`4{@I3B6}]]5n,d document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>') [)KUF W]2?-p t|5f
window.onload = initializeBall;v|1w0[E0O(@v
window.onresize = new Function("window.location.reload()");g BJm m`^{:Hzs
}5a+r;b_ ?
R;yz{^
</script>

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


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