|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度
0 e! g# z8 }# J" r& u% jvar marqueewidth=3005 G( |5 t) R" s% o% n
//高度
8 c6 w& i( s' Z0 L$ L3 r: }var marqueeheight=25+ N- w5 q8 q. x+ j- u5 \, n- P# k
//速度(1-10)
* W3 D; L" N" f; G8 A6 D# k) A8 hvar marqueespeed=37 z& H' k* I* e2 [7 o2 @
//背景颜色
" u7 W y4 y, E9 l# q0 Rvar marqueebgcolor="#FFFFFF"# P3 R9 o8 K4 a3 c2 e9 r" h$ I
//是否能暂停 (0=no. 1=yes)?9 ]" _) O$ N0 t$ U$ z1 @: X
var pauseit=19 a. p: ]# y9 e) F7 R, _) q7 _
* |' u5 T* n8 C5 R% @/ c
//修改显示内容- y3 c9 |8 P. b5 j, _% v' Y
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>': v" [0 ?" n& o1 e
+ v; t$ b. p1 R* r8 g- d/ x
( Y" t" o4 f; s, e3 `2 a: b////下面不需改变////////////
6 Q( ^7 @+ b9 j1 \$ W& |" h5 f! _" C* d" E0 {: ]! Q- v
var copyspeed=marqueespeed6 t" @" z& F. d
var pausespeed=(pauseit==0)? copyspeed: 0
/ S, [1 j% r) Evar iedom=document.all||document.getElementById' `( C6 O2 q- q( c/ C2 E3 n1 S
if (iedom)5 g# _" f# O2 l" z( X- _, ]
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' C. e' }2 b# ~: Q: l" M/ _" s
var actualwidth=''! \9 V# S0 J8 a( S. ?1 j
var cross_marquee, ns_marquee
& X& |3 \( h3 {. g% v; E! U4 a+ H" }" _+ y
function populate(){
. I, O0 s, F. \: Xif (iedom){
: \* k: o2 m2 Ucross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
+ T; ~, }( W! L! l" `& H4 k! wcross_marquee.style.left=marqueewidth+87 [( d* k( `$ a' z4 o8 X& k
cross_marquee.innerHTML=marqueecontent c8 Z$ e" f4 B' L9 W+ D8 P6 x% F; U
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
" d$ q C2 `8 P5 ^. a) N z}
+ p$ J! ^5 m7 b, P2 Melse if (document.layers){
$ R" E3 z8 e) T0 Z, ?3 uns_marquee=document.ns_marquee.document.ns_marquee2
- G6 m, W3 `6 C, t; gns_marquee.left=marqueewidth+8
7 f& M/ o( B0 `5 N6 S1 V2 Fns_marquee.document.write(marqueecontent)5 N' T; S" F( c# v8 H6 S5 M
ns_marquee.document.close()/ u. u7 |& @6 y6 I
actualwidth=ns_marquee.document.width
! p& F; n2 A! O. s0 u& Q}
2 h8 K* j7 M: ]+ r, o1 h) n" Wlefttime=setInterval("scrollmarquee()",20)) X6 v9 C- r3 `7 G% h6 [
}& H+ Z: |( m; A% J: e5 L: D% L
window.onload=populate
5 p2 R4 w% G/ ^. v5 b. r( G
% m, o" e- j) O5 yfunction scrollmarquee(){/ ?6 X2 u7 _! `$ C
if (iedom){
1 X, B# [" R c3 ?8 sif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
& v$ N5 X, H' Vcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed0 r3 o: S* F# ^/ U4 U, c
else# {2 \3 h) @) i0 @
cross_marquee.style.left=marqueewidth+8
/ Q* X. U4 A& C8 M) S( e; a! b% y5 W+ `; H/ ~
}! B3 T5 `8 Z" f' c! a4 @
else if (document.layers){* c5 J/ w& n8 I
if (ns_marquee.left>(actualwidth*(-1)+8))
+ K5 z/ j- V7 A7 J/ K4 \ u# Mns_marquee.left-=copyspeed
1 {& ^* ^1 V/ v, x; \* melse8 b/ d- x" `$ F$ u0 I
ns_marquee.left=marqueewidth+8
+ {: h5 d$ {) {7 H}
$ \: Z" e( g5 b& I}4 V+ _5 ]5 y: L" [3 Z4 |7 P7 T
7 k0 P9 l# X; r. s* d% Z$ D
if (iedom||document.layers){0 R- t( t5 z+ x& B) D5 N: i3 M
with (document){% P5 [- K6 `, h2 z0 ~
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')* J: X- D7 i& _) z) Y* y9 O+ ]
if (iedom){% l- j' V) x9 a# j
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
- X$ ]: @8 k1 Y! W5 Ewrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
! y$ ]* `* J: X$ y. \write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')' X# {" k1 n( ?8 F& i) _4 P( d
write('</div>')# k3 u# z7 f9 ^: z2 m
}" s0 T! ~' X+ i$ E! s
else if (document.layers){% o c; J# b: \! C: P- s: W2 n
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')# q9 T+ @- q! m$ f6 h) b
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
2 V8 S% S' e" E4 I' xwrite('</ilayer>'), C4 R0 [$ U: Y* U- n/ c I/ D8 Y( n
}
6 ?9 ]' M# l0 r) f4 V& L( qdocument.write('</td></table>')* L2 U7 T( z! \/ B1 ^$ {- C1 ~' @
}+ ], U8 u: L) U$ t' V
}* ~5 _& I1 M4 J9 x! B
</script> |
|