捌玖网络工作室's Archiver

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

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

<style type="text/css">;iw|O2ZC8sg
#supertext {
~,E S o6S position:absolute;
@0I gu!p{ left:0;Y^ik6sM+fL
top:0;
Y bk:O Y HO visibility:hide;+o$@p"A`Fp7{ `
visibility:hidden;
9[F;R,L3f'`T }-N+FVJTk1oD[
</style>5d{7V/voN,ePQ+\,a
<script language="JavaScript1.2">JH8vVK:v(@FX\
<!-- 改变下的字体的大小。颜色-->2mOSBEXL-O7n
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
Oqi5aU6}(]{ var hidetimer='';z0[Y6@(B
<!-- 改变下的弹跳速度-->M5b4K,u }ahb
var BallSpeed = 20;'t+Z:i@*K!{
var contentWidth;
;U7G G8|O N/{!t var contentHeight;6~0gw*QG^#]
var maxBallSpeed = 50;1Q$n8V u0o;nt.P,GlU
:VO+E*Dh'c)T[X
l)g~7wU'@&M
var xMax; CI w(c-ukl
var yMax;6F7WLC6s2gX"hs
var xPos = 0; \1ZGu.`gqJyq k s
var yPos = 0;i)?MF,@jm
var xDir = 'right';
#gT#fI5O3yY"^ var yDir = 'down';
M2gb4Z$A0rkq var superballRunning = true;)i"m Og*{Y$GpDK&}
var tempBallSpeed;N,[d!WCe$Q9C|
var currentBallSrc;
0YS2|:P3mN N var newXDir;
yD-VR\z var newYDir;I Fz7V1\(~}$R#H(^3t
O{B!|:a"aM
function initializeBall() {7d?!Y6q7o%C{2nx3S
   if (document.all) {
G Kv0P-G(R       xMax = document.body.clientWidth6z4^3["P[#F_$h
      yMax = document.body.clientHeight u q8c1d:G2Q
      document.all("supertext").style.visibility = "visible";k)l1X:fn
      contentWidth=supertext.offsetWidth
%V;D*Ju0X       contentHeight=supertext.offsetHeight%W$D8k:czT
      }0dO&s(y.O$\ ^
   else if (document.layers) {@8gaL.Y5XL}
      xMax = window.innerWidth;
$U yrBz?7x5W8WQ3y"o[       yMax = window.innerHeight;
3fd T_N Dd.U       contentWidth=document.supertext.document.width!c HU$c'g/rv T'{8n
      contentHeight=document.supertext.document.heightBH%|5^VUX
      document.layers["supertext"].visibility = "show";$n$l+V tM Lq.G
      }
y}#U,mq\ uw&sz    setTimeout('moveBall()',400);
\-l%nG,BJ    if (hidetimer!='')
-G%? } jKVoM(h    setTimeout("hidetext()",hidetimer)L#C,a5m3{a2W.fn
   }ojw M$u%t0`/O \
$H'f[9_:H4j$X
function moveBall() {
.io&n6]z/|c    if (superballRunning == true) {'g8V"D-y6N
      calculatePosition();@EW7a2tHx
      if (document.all) {Bf\)}x5yM.l
         document.all("supertext").style.left = xPos + document.body.scrollLeft;2H)^q6\qg?Sl
         document.all("supertext").style.top = yPos + document.body.scrollTop;tZ-A+u v'{+I
         }K a7S}eH}
      else if (document.layers) {
IjWK {*lg          document.layers["supertext"].left = xPos + pageXOffset;
| BGT/c Ks*GnI          document.layers["supertext"].top = yPos + pageYOffset;Hr#\U c|E#MF l
         }gS"vS Ki
      animatetext=setTimeout('moveBall()',20);
0Q1cQ&mD1vF d       }
-ote{9K@C~:`    }
d\8RY!]:c"\4_
6lq7L:u8M function calculatePosition() {:M7hi],^"e_
   if (xDir == "right") {'v)c u'D#LQn$? H
      if (xPos > (xMax - contentWidth - BallSpeed)) {?Y^3k RI-J
         xDir = "left"; b[+B*y{R'T
         }P&t7p9A:J-d
      }
r*\Z^d4C4@zE7D    else if (xDir == "left") { `5^,Eo"Jj^
      if (xPos < (0 + BallSpeed)) {"z&r4K9{8_|
         xDir = "right";r!Hh%Dkh
         }3D"B p4aIQ!@i
      }pmu9KRN:mR
   if (yDir == "down") {@ \(z6c?|+m
      if (yPos > (yMax - contentHeight - BallSpeed)) {
FvRv-J}5e          yDir = "up";+H6}']7|,e$W5\Vi
         }~'n/{ mZkN-aT
      }W:En0rDBS4I1X
   else if (yDir == "up") {
0D6X[}e       if (yPos < (0 + BallSpeed)) { x6[+cb6K%x7]
         yDir = "down";%v4].Mee3ung0|p
         }&n-c_V*R^L
      }3o6|p+}"p2r)y?gS
   if (xDir == "right") {3Z&Y1^BC1@8G$}3f-{!O
      xPos = xPos + BallSpeed;1i0K\;nF+Q h
      }q+V/q e:G\
   else if (xDir == "left") {D] oRT\"pc0v
      xPos = xPos - BallSpeed;swh|`\$Nu ZF
      }^,^U2X|i P R%P
   else {
9O b1wcv.B x3y       xPos = xPos;5qj f;Z$b}^{sm
      }
k8t/K7p BD"TI3Wu    if (yDir == "down") {xbnh&O2? y
      yPos = yPos + BallSpeed; _ibC Y(o:|ns
      }
P/v1h)s[$t\c    else if (yDir == "up") {S^A8x)b+gY#wB
      yPos = yPos - BallSpeed;
bTV"Zepb v I       }
3C*s(_f$_Wu    else {
D yhk/DH%y8k {       yPos = yPos;5jEz/oL
      }
)?&xukR%o@B    }
XCk.K hq3Z i+}X:U f}-GL\#q]%QH t
function hidetext(){
&E"XIi0]{Q if (document.all)4qbc!M-r`Z
supertext.style.visibility="hidden"7K1a1qOY&p7T'v&w3k
else if (document.layers)Rs"Qw/N
document.supertext.visibility="hide"} S@m&x-Q V
clearTimeout(animatetext)
H? x m RTR.R6vm6s }
|f P`\ n
4zg ko#b | if (document.all||document.layers){
3}9s.k/q)bDs(`Q document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')p{[!~{s%cF2IZp
window.onload = initializeBall;*g)w+eF:R:Fn:m%^)?
window.onresize = new Function("window.location.reload()");&WkX7S~tIh Ln'C U,F
}%P7M7fB8Dz`
1|;b+jS9V
</script>

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


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