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

|
网页之跑马灯文字特效
//修改宽度
' k- r; \: |1 tvar marqueewidth=300% l; I7 B' n. X; `* G! {0 f7 E' K* X
//高度5 Q4 K1 J( [# o: A# r7 l2 y$ w
var marqueeheight=25
& ?- U5 J' \1 ]! W//速度(1-10)
% J' D/ f) M, Uvar marqueespeed=3
, h/ I7 ~5 q- l4 Q//背景颜色3 l7 \4 B( t; t% ~/ Y8 N6 d
var marqueebgcolor="#FFFFFF"2 ?1 j; n, i" P* e# G
//是否能暂停 (0=no. 1=yes)?
% x; l: O7 I8 {var pauseit=16 m/ u4 {( X6 f+ U' T
, q1 c4 h" F; L7 _
//修改显示内容
/ \7 [; I) ^6 |% f( I" C3 V9 D8 A* [var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'% z/ n& [' a; A
9 l$ |' G% \1 ^( V: i Z
4 Y8 q7 ]5 S) D, B- ]- I
////下面不需改变////////////
# r3 Q1 h/ N1 t% ?$ E( F1 J9 F1 Z) P, m/ G8 r
var copyspeed=marqueespeed) K& W# }0 v( m7 A, N+ |
var pausespeed=(pauseit==0)? copyspeed: 01 [" q# R% V4 J( I5 f1 ~
var iedom=document.all||document.getElementById
9 L! ]. j. `7 S. sif (iedom)
K" g" L+ F- z8 h( C" L7 udocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
$ H; X8 I- y& _; }var actualwidth='') p. F6 {$ E# j8 S5 x! {+ O" _
var cross_marquee, ns_marquee
0 e9 g, p- w; l+ O& J0 C* k
- w4 k( Y: ^2 z$ }7 S' x: ufunction populate(){+ j0 Q$ J2 [3 x& W0 d' u5 C4 e
if (iedom){
( ]9 U; A8 K& ?1 P x. }cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee/ l$ u3 `: D( k' d2 t# l7 i; g
cross_marquee.style.left=marqueewidth+8
) O& P# r7 y* |; B6 h: ~cross_marquee.innerHTML=marqueecontent& T+ V! p. V8 v/ M" x8 |7 X, H
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth- ^3 K$ G; v5 Q2 i) c9 l
}6 p( A8 E: x5 ~1 @- x/ Z1 }
else if (document.layers){! [5 D" H. D- A. v! T
ns_marquee=document.ns_marquee.document.ns_marquee24 q* F- H2 r( @$ g" L* P$ y& O
ns_marquee.left=marqueewidth+8
5 `3 A- r! p/ n j; Ens_marquee.document.write(marqueecontent)7 M% L4 w/ @! F0 f( V0 H* h
ns_marquee.document.close()
( ?. X3 N2 V [& Y- Lactualwidth=ns_marquee.document.width7 R5 ~0 t/ G8 w* T2 ]
}
6 t) k+ t& N, n V9 |" dlefttime=setInterval("scrollmarquee()",20)" L# t! H. p0 ~' i% H+ D
}" C* o9 o4 \" K# x0 t4 J5 ~5 V3 c
window.onload=populate
4 c% [! p! }$ Q6 a9 ^
0 w, y v% c8 Y7 Q4 g2 hfunction scrollmarquee(){2 b# Y4 b5 Z: s( p0 Z g
if (iedom){, ]6 Q8 K3 {) V8 K0 `! E2 M
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
" @7 ]3 O H0 k! r& B2 |/ O( v9 Xcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed1 E# w7 i+ ?: h. G" X( B% ]. |$ y
else: l$ |8 o0 v/ ~; Z1 U
cross_marquee.style.left=marqueewidth+80 e8 Q1 p9 t9 U$ R, p
" J' Z% U# [5 O* V0 f
}5 g3 v* O( D' C
else if (document.layers){) r3 L+ d" ]3 _) j
if (ns_marquee.left>(actualwidth*(-1)+8))
# B8 f9 J. n, C* ~# ~7 K0 T% Z' ]ns_marquee.left-=copyspeed! Z N' T5 |* s# K# P4 h0 N i- H
else
9 ]& f/ M' T: Y% m* m2 a* Ins_marquee.left=marqueewidth+8 s' T5 h6 N l! |! ?
}
. A' d. m8 o6 ?4 [$ X: e}
2 X& U1 E* ]: q u! R' G5 ^# }; O/ v! f) S; k, x
if (iedom||document.layers){) o' M, |4 B5 G
with (document){
3 O$ t5 Z: X$ n) V( }/ Y3 Ndocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
! Y- [; q4 p, f6 I, h/ oif (iedom){# i! v& q K d( Q1 j; l* g
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ J. M7 Q; a2 X% K7 H, ]
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
3 D+ C/ l- m! W) Rwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
# \/ k7 d" a' V! g7 }write('</div>')
9 w% v/ K3 j" U0 a: S}) k$ d. Q, E. d. `
else if (document.layers){6 n3 J6 W) s0 Z4 k7 {4 b: R3 I
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
- G& f' h7 F7 i9 cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')9 C) |0 c- \: r9 z" P, A. {
write('</ilayer>')
0 @0 Z4 c" R0 e# p3 K& {, o}2 K6 L' G6 r0 m: _- R" ]
document.write('</td></table>')
& F: m9 s& L1 n, P6 I0 Q9 d}
5 U$ y. I' \. y}
" @! R% M: |% K( b1 a. ~) T3 u' q4 y( N</script> |
|