网页之不断弹射的文字-特效
<style type="text/css">#supertext {GUEn(W
position:absolute;uMp].A,K"Q
left:0;-{*j2`!k5}5K;}l
top:0;0hhT'bT3x7w
visibility:hide;
visibility:hidden;"q}.R&_S+k$uB&k'q
}a(opQWj-l
</style>%z0Ff`&h#["{
<script language="JavaScript1.2">
<!-- 改变下的字体的大小。颜色-->wA T(M$^'C)igM
var thecontent='<h2><font size="2" face="宋体" color="FF0000">欢迎光临七色风网页家园</font></h2>'
var hidetimer='';1S0W_3[$uMx-WT
<!-- 改变下的弹跳速度-->
var BallSpeed = 20;#[$k"CJ.L HMP$Kn
var contentWidth;$eB~W#a
var contentHeight;uyX"f!Y
var maxBallSpeed = 50;
[]LT+v
var xMax;
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = 'right';
var yDir = 'down';
var superballRunning = true;
var tempBallSpeed;B*}^ji x n
var currentBallSrc;
var newXDir;
var newYDir;yo$}M!h7IY
function initializeBall() {hN&`.w ](Lv'@
if (document.all) {2@|/D'],B!Z
xMax = document.body.clientWidth @jra!f)dH
yMax = document.body.clientHeight
document.all("supertext").style.visibility = "visible";
contentWidth=supertext.offsetWidth r%?/jS0O5w8@ G
contentHeight=supertext.offsetHeight
}B|2K5tt6? a+gGW r2]
else if (document.layers) {
xMax = window.innerWidth;
yMax = window.innerHeight;*K x2VE$A_U
contentWidth=document.supertext.document.width
contentHeight=document.supertext.document.height
document.layers["supertext"].visibility = "show";:aNs+~A
},jno2~.MMz/h1@
setTimeout('moveBall()',400);
if (hidetimer!='')
setTimeout("hidetext()",hidetimer);yQ^K4Tx|
} aOHp)Vzuy9b7iUk
function moveBall() {'p/l*dpo"j/y
if (superballRunning == true) {C"QC3~+^!n+C
calculatePosition();B2Y2kT6fA;pL N1I
if (document.all) {
document.all("supertext").style.left = xPos + document.body.scrollLeft;
document.all("supertext").style.top = yPos + document.body.scrollTop;Ls`X3Uq;i?
}
else if (document.layers) {
document.layers["supertext"].left = xPos + pageXOffset;6w,x[*~1S+?L)SFPvg
document.layers["supertext"].top = yPos + pageYOffset;9g.of$[6TB'K S@r+E
}
animatetext=setTimeout('moveBall()',20);
}
}
function calculatePosition() {
if (xDir == "right") {)ePr7S n1Y
if (xPos > (xMax - contentWidth - BallSpeed)) {ENqWd]6c'Gj
xDir = "left";
}\:Pqx#NP(|#e ]
}
else if (xDir == "left") {A$D#pV?'I#s
if (xPos < (0 + BallSpeed)) {
xDir = "right";
}
}
if (yDir == "down") {
if (yPos > (yMax - contentHeight - BallSpeed)) {
yDir = "up";
}
}R;HMx(t!m4~d
else if (yDir == "up") { b_0wcW2y[R)tx
if (yPos < (0 + BallSpeed)) {
yDir = "down";
} T T%`/O}5^
}
if (xDir == "right") {
xPos = xPos + BallSpeed;hPf(T5Gh5` f
}
else if (xDir == "left") {,R,r%X-p+Y9g5x
xPos = xPos - BallSpeed;6l@mN8Pc/F#B
}
else {^Zs1xSF R*M*a
xPos = xPos;"Yy MO.{@G/}
}2Y9PfiM#Tp1J
if (yDir == "down") {
yPos = yPos + BallSpeed;-F-\/_O)H
}
else if (yDir == "up") {q]F(QQobA
yPos = yPos - BallSpeed;
}
else {
yPos = yPos;
}
}
function hidetext(){Gi"`y+n t [5a
if (document.all)
supertext.style.visibility="hidden"
else if (document.layers)
document.supertext.visibility="hide"
clearTimeout(animatetext)
}
k`m1X)BS7q
if (document.all||document.layers){ o.[!l;Rj:S)Aj
document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>')&{Zk+K!q"@k^
window.onload = initializeBall;
window.onresize = new Function("window.location.reload()");%tk"Pf ?(s
}U(v6M!L} P2h+|
`GCz(oDvr
</script>
页:
[1]