捌玖网络工作室's Archiver

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

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

<style type="text/css"> M] d+us;C4dR:C5?jmA
#supertext { w"W H+mu2?*}0_X
position:absolute;Yl#Ld2r;rZ(|i(nC
left:0;
@D:w)tlVR7y[.I top:0;&y*|o i Y
visibility:hide;
9[[&^)HPPd @ visibility:hidden;+_F"KaT+~
}
}"ylSBr8H2RWI </style>C ^3}.B6j5? d.v/e~b3A
<script language="JavaScript1.2">K'~x7t"A-V.b [
<!-- 改变下的字体的大小。颜色-->3?4D#\#EY-G?$`l/~k
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>';Y.p'd {*X{
var hidetimer='';
H`g3U0o*R1w Al <!-- 改变下的弹跳速度-->
R$GN @,R zFt var BallSpeed = 20;
6U0A)m"L,Eu Yk/V var contentWidth; A^^3e7_l+n
var contentHeight;
T;\c8k2m)t;N var maxBallSpeed = 50;b`$RsB X-{

*o}rQR1F)vcU.x!G 1J HR+w)l ia^z
var xMax;
a*W[|2iy_7I7n7c var yMax;
;g#m!c;y'`~*b;HO,UJ;_ var xPos = 0;
%N9B-vXGF3h~ var yPos = 0; _8X)^u.`.Y&j
var xDir = 'right';
zMo"n5T var yDir = 'down';
!_C;]N)fXBL4a var superballRunning = true;4k\Yut:|[5_fb
var tempBallSpeed;&v!k_S1BP;|!dR
var currentBallSrc; @bgP ?+hQ
var newXDir;
[ eiu [w WL var newYDir;
"s \D)ii$l1{9T6F
L&O2WU)t Sod(g function initializeBall() {
6`6iX%V6~1x9G ]%D    if (document.all) {u6KeWd
      xMax = document.body.clientWidth})~9uq@8D-s#tm%n
      yMax = document.body.clientHeight
;]QVq`%JV7gd       document.all("supertext").style.visibility = "visible";2io g ga;eO4q3t&J
      contentWidth=supertext.offsetWidth_ GMa$a4T3f4j
      contentHeight=supertext.offsetHeight ds(hW&?%L gq
      }
6~5Qw G(F+n~.b Q    else if (document.layers) {
!H j/z8Q!ch)`       xMax = window.innerWidth;
U}%X X)J'Gy       yMax = window.innerHeight;
(~3_ wk(F{,? l       contentWidth=document.supertext.document.width
0~3Cs#RL9|/h2[ KL       contentHeight=document.supertext.document.height$x;ipv'I G_J o v
      document.layers["supertext"].visibility = "show";Z5_/X}p3j
      }F w v6zo"Q]1K,Q:B
   setTimeout('moveBall()',400);']u~(k9pZ&RN0g
   if (hidetimer!='')!Mq Rl$g$W-wY
   setTimeout("hidetext()",hidetimer)R9QW?3jGEi5B
   }
;MO[4DiG K/w5d:B,r \+eSbcu
function moveBall() {
G6t~ |*h [3o    if (superballRunning == true) {!L+YN!p5m2R W5j0B;ih
      calculatePosition();
5J.Z0|K&G3q       if (document.all) {[/B0Fv)ni VOW1]sa(U,}
         document.all("supertext").style.left = xPos + document.body.scrollLeft;
8M5W$ru B7q-AM:CTc[#G          document.all("supertext").style.top = yPos + document.body.scrollTop;
,?%^\Hb-Y*]} NX;K          }
m:wq5MQ@P       else if (document.layers) {
,@O,gt%EN"t          document.layers["supertext"].left = xPos + pageXOffset;9B5`,E0p AVzcG
         document.layers["supertext"].top = yPos + pageYOffset;wA+T1s${n
         }RZ*mGH
      animatetext=setTimeout('moveBall()',20);
0e&P7y&w4L%Ev       }
9z8V8ds,VBRjJRO    }0g7P SE&E |+j

7gF1sy ~"@(j6iQ function calculatePosition() {u,V!Hz{#o
   if (xDir == "right") {
r;b+I:I%_GK4[f       if (xPos > (xMax - contentWidth - BallSpeed)) {'q+G{$dM{6rCK |7a
         xDir = "left";$nh^3p5O
         }!WlWi8w
      }/S s3u0eP SFf
   else if (xDir == "left") {.A V_ F|Q-d_~k
      if (xPos < (0 + BallSpeed)) {
(U&}oc$Rn+D1sg          xDir = "right";
*y:S,i)F!xr"K          }5W$hz {+B`X!|v*c
      }
B"B2?B0G]7Ni5NvR \    if (yDir == "down") {
0dd${;{`Y6nR3b1b8P       if (yPos > (yMax - contentHeight - BallSpeed)) {q4Q!I w/g3b
         yDir = "up";
w2|&|O6[o j ];c          }
F3M\t*}'L       } w|7py,u
   else if (yDir == "up") {,q4wLB(I\Z
      if (yPos < (0 + BallSpeed)) {E-r6k)Nx-g E
         yDir = "down";i)jq i#iu+B
         }^]-g1x!p{4x([K)M
      }
h SQ5m,HY'N.J7b    if (xDir == "right") {
a` MS,gxw       xPos = xPos + BallSpeed;
E7\ F*`7q       }
sD3N0\ U"EC    else if (xDir == "left") { G(mM+t%h,D M?
      xPos = xPos - BallSpeed;
,^j1A%v&O-E0C~       }4] W&QtX6M_8n1~)Y@4M*\
   else {/bH)pLB
      xPos = xPos;
y7wB.]6o/T       }
d.Go;V?!B%avx    if (yDir == "down") {
T v_2B;Mg#Rib!t       yPos = yPos + BallSpeed;
V q@6Gr'rSGV4D       }
zhWl.}|    else if (yDir == "up") {
5Rn&[nka7K{       yPos = yPos - BallSpeed;9w W#ylE
      }
[!pqs-z,BW    else {/c4s8s2p^&{(Q
      yPos = yPos;
"} s1cu V*i8`,qu       }
N%_My4tKin L    }_R/NOfjT
w k+B"jJD
function hidetext(){
eA{ zqp n ~7e u if (document.all)1J9s)jwd"dq
supertext.style.visibility="hidden"
y ~ \cH9lC else if (document.layers)
D1Ms9C/t)FRu [ document.supertext.visibility="hide"+q8Gk+S)u)U&l+@
clearTimeout(animatetext)u`2dkq;dX,LS
}
Iq(HmG^Nk
&HgSy+jJI if (document.all||document.layers){
b8}L5s;dDkK document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')%^P.R*AG dls$m2C
window.onload = initializeBall;
Kw"xM%N*` window.onresize = new Function("window.location.reload()"); H _h nI#d9jI:}
}
&aOp1`J
%M{g9Z3Dwjg </script>

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


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