捌玖网络工作室's Archiver

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

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

<style type="text/css">
xM8v hU(U*g #supertext {
"[5@'U4fK n.XkU position:absolute; ~S"g;E?ObW W
left:0;"z%R { a2F-x `
top:0;lZ7iE ?ER"smG2S
visibility:hide;
.Xd Km ~} visibility:hidden;Ch8T0{h|
}9~vms-V|8f
</style>_-O|m-u&}
<script language="JavaScript1.2">.d}'h'K6bu+?&H H$W
<!-- 改变下的字体的大小。颜色-->
b+L~W!| ~T6K\9W var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>' izRd8^
var hidetimer=''; Czyo@:B
<!-- 改变下的弹跳速度-->X H[Tc)v4rAF
var BallSpeed = 20;
(G#V8?t7Aum3@x var contentWidth; g g_5U e RL'`
var contentHeight;
{K&CZ8n7LY ~ var maxBallSpeed = 50;K5}7uW#?$s;|
#P f Q&d Ma9|5j

CSmj*^6Kp'U var xMax;
kF N#_ Q4L?2h var yMax;Z-E/s#Lb
var xPos = 0;
;A)}mS${6Q!iK0['b var yPos = 0; tK8i vw
var xDir = 'right';E&p}`1kh3g b L
var yDir = 'down';6qjP)z b:H&di
var superballRunning = true;b~RC)O.| f
var tempBallSpeed; VeAP8a'_
var currentBallSrc;%L"l)nL C i1J
var newXDir;
C+k M G6gi2t8@ var newYDir;
XMt GMqv,H
v'c@cv1c&f function initializeBall() {B S$|"y0C0I"u
   if (document.all) {
dpr qb       xMax = document.body.clientWidth
P;@/{1m1g"E       yMax = document.body.clientHeighttr[6I#b[ XB/A
      document.all("supertext").style.visibility = "visible";
:c-tB\s*C J'O       contentWidth=supertext.offsetWidth
H+~9Y.BASN R       contentHeight=supertext.offsetHeight3j9w~f,FOV
      }9]/U#Xl/g1R%Ce
   else if (document.layers) {mE0mxA.{4l:o&CbS:i
      xMax = window.innerWidth;,C)}*^8K9D]
      yMax = window.innerHeight;zm'R j9eSuf
      contentWidth=document.supertext.document.width
lAym ~"M/}       contentHeight=document.supertext.document.height
~+{W%A7c8gZ       document.layers["supertext"].visibility = "show";E5T9Z)h8[e
      }3?zq't#c9m2Nkn
   setTimeout('moveBall()',400);4F9{2Asn |&u
   if (hidetimer!='')Eq3o&}t/mR#\
   setTimeout("hidetext()",hidetimer)z|t$?q\m:N
   }
.uE%T8];S{ |-g~6I5do
function moveBall() {"SkpVOfU
   if (superballRunning == true) {Q+d?:? |cp
      calculatePosition();
Ol?#j:N8eT6ZI ~       if (document.all) {XT,t%i@0~
         document.all("supertext").style.left = xPos + document.body.scrollLeft;*T,_l#R"kE
         document.all("supertext").style.top = yPos + document.body.scrollTop;T gc-E\/eZ}A"n
         }4Q5i-hrl.FR6S
      else if (document.layers) {TD yI0^Z8B0h:s
         document.layers["supertext"].left = xPos + pageXOffset;O+x&G5L9c:T
         document.layers["supertext"].top = yPos + pageYOffset;9fE8cXe NSZ;q
         }[D]5FDFN,z1U
      animatetext=setTimeout('moveBall()',20);j Hq:~.b a+wc9A2o
      }$If(Ne}K_C"G
   }ke#]%S,?"x9a^Wvu,dw
j1S.C7Ow2Z(x
function calculatePosition() {
2B&bAJ/y&pK1Q    if (xDir == "right") {
4h1c$e2F1DZGT       if (xPos > (xMax - contentWidth - BallSpeed)) {FpsK*o5Z}}Q]
         xDir = "left";J9\0w5hX#Ld G#c
         }3u\Pf q4w-h|3jZ
      }
%Y'dLA@ k4W'f    else if (xDir == "left") {*\*J%zi:L3B#l4W
      if (xPos < (0 + BallSpeed)) {@|`$F6L
         xDir = "right";
.LuqG{1Q          }N7f*S'r5om
      }
y5V,rFD    if (yDir == "down") { Zol;J5] f
      if (yPos > (yMax - contentHeight - BallSpeed)) {
~^4WQ l          yDir = "up";
]/Dj1Y*Q x%ZdL          }
GE N$e9M*D       }
iG0@&A z W    else if (yDir == "up") {5Fe nB4QH F0x@9H
      if (yPos < (0 + BallSpeed)) {
d&F CyNb4xy          yDir = "down";
7}rU"C7VlTD          }
7jD7J O"cmh       }[%H?f4f:R
   if (xDir == "right") {
Y7AJN:v$F       xPos = xPos + BallSpeed;$GT TzmFYy/L
      }
5mP({%t'Q7R)z    else if (xDir == "left") {
p3`P5IU       xPos = xPos - BallSpeed;!A1P$psH#a v
      }
3X7uG Ci1E    else {
t-UwP"]Ke1r!P$o9P6s       xPos = xPos;7E"@-D+Sf
      }
~8kT#Q gT4k    if (yDir == "down") {
*QM3ox$XI       yPos = yPos + BallSpeed;
w Lh/GP8r       }
?4o)R GJ    else if (yDir == "up") {6p^8rEe&A-W-r(T
      yPos = yPos - BallSpeed;4jv7^+XrC
      }7Lw\*WAB
   else {O$b1MPq%G
      yPos = yPos;fF L#Z1Y%Q x-v)\
      }
|i8q,t|XthB    }
(v!P4a4y],s )b(~4L1z,^_OWW-H/s
function hidetext(){
3n,LC4] g3_ if (document.all)
R Zxx%H%k}IaC supertext.style.visibility="hidden"
g#fl"fmL;wvF else if (document.layers)
~%ZX~b I`rlA'y document.supertext.visibility="hide"-K.}0s[i MI7e
clearTimeout(animatetext)^:r2g&\*I)yU.M$sv
}
#q'u8fM `j ReK
%m8o9^~l u5GD if (document.all||document.layers){xJh A%t.c:I
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')
7?%NtGG,A8O5n window.onload = initializeBall;
%CE)t EbNgy~;i window.onresize = new Function("window.location.reload()");
DzNwR }?7E:p'tL&m-U5I+V Wt(y
|;l+}U8CcT"g{
</script>

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


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