捌玖网络工作室's Archiver

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

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

<style type="text/css">O1t3pm:PxS
#supertext {
UX7k E W@6Stl position:absolute;+V*|.|$M8s?7\ G Q
left:0;
n%aX)I%| top:0;
m/e9t1{w1r `N6}"XG visibility:hide;yl)bz3J
visibility:hidden;
4BAUP&[#qX }
2jt2b%o!v:@eC </style>5m"]'@E;o9_ \/V1E
<script language="JavaScript1.2">
.K;j9t"]9gla <!-- 改变下的字体的大小。颜色-->?RZg!f&tT.N
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
C d't/a,\#Y5d[ var hidetimer='';Th{&mds
<!-- 改变下的弹跳速度-->
]gI NtgZ] var BallSpeed = 20;
B%kG#FH4o5r var contentWidth;
U(cD}$E;{*h var contentHeight;
E/~ooN} var maxBallSpeed = 50;
+[a5rKa0RsPaV 3I0yD5l J*K$NT
0w_#Xfq
var xMax;
&v1f7pQo var yMax;#Cc2To0vfT
var xPos = 0;soTc%N4r,a
var yPos = 0;
/OC0{A ^w`-A var xDir = 'right';
$\wq j d S var yDir = 'down';'{+gA2NV+\mM:t"D
var superballRunning = true;0HnL X.|
var tempBallSpeed;
oj;}#[9d9au var currentBallSrc;:X#Xmup[%J9J
var newXDir;)h-WI$y4l1j L p k
var newYDir;t:aP$wn

Dh*^7L@,t function initializeBall() {
:e0Ph;h/wRz |^    if (document.all) {:RI0r+XQ!AK&@8Xtt
      xMax = document.body.clientWidth
@?VBjB       yMax = document.body.clientHeight0c A8?7wr2Sk
      document.all("supertext").style.visibility = "visible";
\D SA*Dgh       contentWidth=supertext.offsetWidth
3o9WF1R#J g       contentHeight=supertext.offsetHeight
w"m-l {&a)?       }
*F xrb%CgK    else if (document.layers) {
{bdex:c\'M"g       xMax = window.innerWidth;eFEv w@
      yMax = window.innerHeight;ztI6{8Ng4VsO
      contentWidth=document.supertext.document.width
7Z M#DG9f L3q       contentHeight=document.supertext.document.height&| n%P2To9N`
      document.layers["supertext"].visibility = "show";p `n2\].z"^$J*E
      }.N i9Y]N ~
   setTimeout('moveBall()',400);ha4O2yBE*n*Q
   if (hidetimer!='')#vH{ ]9I(S
   setTimeout("hidetext()",hidetimer)
#M2f;nnw0g`    }{,`,PTc6K

4`9z}P%Ec function moveBall() { liS wl!~UD X
   if (superballRunning == true) {
sj.a1g+PlK       calculatePosition();{-_0N5U]J;b'|
      if (document.all) {
P@%sk;U'l          document.all("supertext").style.left = xPos + document.body.scrollLeft;
sv1^!tP          document.all("supertext").style.top = yPos + document.body.scrollTop;
v0A]f4f8p_(~n          }x"y;JTh#q}|_
      else if (document.layers) {
8l:U;oVG){u:v}          document.layers["supertext"].left = xPos + pageXOffset;
8HL I/`c3_}          document.layers["supertext"].top = yPos + pageYOffset;Z2O~r"D:O&z {
         }
L o~cB7Xi$J1zzZ       animatetext=setTimeout('moveBall()',20);
/i*x"q#sv(M V @       } r,B@S!I8s{
   }WsD0I'K

S%A#PYB$v9Og function calculatePosition() {
(t@2S;Y.m\ek(]    if (xDir == "right") {s|0Ef&f]A6Z
      if (xPos > (xMax - contentWidth - BallSpeed)) {e8}Bc+F:H] S
         xDir = "left";!?k0} EJ+^ { ?p4i
         }\#G({*Lmoe-n*J }.P
      }
E3L.? R)u Gd'L    else if (xDir == "left") {/BaqH-q1\9P]5YRy e:Nl
      if (xPos < (0 + BallSpeed)) {
$Qx O ]E)h          xDir = "right";
4pY&z)fn&g          }
{X+YnZ/@s       } h%y0y0qW{+o
   if (yDir == "down") {
ZCJ.I"w|"{N+i(k       if (yPos > (yMax - contentHeight - BallSpeed)) {Tq(wj-~y
         yDir = "up";
1rAQ2psmjaS\          }
%^t%e?UD       } cQ@%V$]
   else if (yDir == "up") {E'wAV8[ K9g6[,|5G
      if (yPos < (0 + BallSpeed)) {(d L\/i{/s
         yDir = "down";
#A1Pz/caG          }
:N%Y9uk*K,Y       }
JA,m `U E} i    if (xDir == "right") {]K\v,mbNz-I
      xPos = xPos + BallSpeed;9ID C3}U
      }
:H(l%| HK(["`    else if (xDir == "left") {
g@i8x:TC^1C       xPos = xPos - BallSpeed;@WlUQ?;VB
      }
RAg&A]    else {
;qH#NL?x1t ~8@#Q|       xPos = xPos;
G OwYz       }
^'o$k5VRg I#K    if (yDir == "down") {~k!b0n|1L[+A a
      yPos = yPos + BallSpeed;
!L;agTI"n.VM|       }EH.UZ:}1bsK i'^Vp
   else if (yDir == "up") { C8H4i_P/Qxz7Y
      yPos = yPos - BallSpeed;X MXz0qKK
      }
W4R&m+w3|f7E2\    else {hC&ji5h"F@
      yPos = yPos;NtVB dY0|^`
      }
:J$?*M| XTWY z;X    }0^hA;tEK
Xo"Z"[Svg:Nq
function hidetext(){/_W C5DQ|)@MR
if (document.all)k Mw la*J+Q5R
supertext.style.visibility="hidden"
+TLXI/zRs else if (document.layers)
b;j+\j R |-U document.supertext.visibility="hide"
3MHg u$L"AxR clearTimeout(animatetext)!`t1r"vx/G3n
}
UBeG^m(b I3RA&ip6d
if (document.all||document.layers){
(d"{Hk/b-d xH document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
!|+SSk]+ct#Y window.onload = initializeBall;)t+|)o!@3e7`uE/J-s)h
window.onresize = new Function("window.location.reload()");1Sya2t#M)bn"`
}%j#nW2z ] a]
7E Nq&W;o
</script>

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


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