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

|
网页之跑马灯文字特效
//修改宽度
8 e$ B* k( ]; @7 d2 C. c* zvar marqueewidth=300' |( b, O/ @0 R @
//高度
4 X E1 P$ N) h' n5 P9 m) @var marqueeheight=25
) W. z& f3 I8 ?: O0 F//速度(1-10); P- U5 T1 p3 H5 s5 N3 N1 l! U
var marqueespeed=39 ] N8 l2 y* f5 s2 d* ^' G
//背景颜色2 i5 h P" y+ _2 `1 o. t
var marqueebgcolor="#FFFFFF"3 n! R, G& h8 H( s2 M' U. J4 A Y
//是否能暂停 (0=no. 1=yes)?
' V+ ]+ a' E) p5 P# d+ R gvar pauseit=1$ _; B* \6 i* R1 f, [/ L2 X( f
; x4 R8 X$ N- l' B4 K//修改显示内容( r5 F5 i, b0 f: h w$ w
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'" y4 n+ a- g% g1 Q3 j
. u( ]. |0 l$ J; i" T& ]. u8 | y1 A4 _% j6 D% N( ]. i3 q/ J
////下面不需改变////////////
) E3 g5 J- V& j9 _6 I; u( B2 N5 T
6 ~+ ^* h, @+ c7 X2 V$ B6 ?% Fvar copyspeed=marqueespeed1 T3 w) N, F7 Y6 ?( u
var pausespeed=(pauseit==0)? copyspeed: 0
/ N9 `$ n W& B& M: z! Yvar iedom=document.all||document.getElementById9 ^7 d5 G( B5 {4 V6 d
if (iedom); F7 W6 B- r! o$ ^0 W/ L! Y2 ]' R% F
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
# E9 `# O3 h0 {5 u; T+ Y9 |6 l2 qvar actualwidth=''" M2 A l9 V- \
var cross_marquee, ns_marquee+ T% Q; {9 v1 {8 s: w5 t' @
0 d( `6 [7 I) y; D1 I
function populate(){$ }. I7 }8 \5 H5 n- e/ ^
if (iedom){
2 n7 Z2 `5 Y, Mcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
0 \! Q+ ?9 ^4 R; ?& ccross_marquee.style.left=marqueewidth+89 s! ~" b7 c$ `# ~8 ?
cross_marquee.innerHTML=marqueecontent7 l. ~! r9 Z6 }! R% C
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
$ N8 v5 S P) }}
$ h/ Z! \$ ^* i welse if (document.layers){8 ^/ ^. ^4 A! ?5 N$ M5 R# H8 E
ns_marquee=document.ns_marquee.document.ns_marquee22 T: c) D5 g$ C2 ]: ]; J, B
ns_marquee.left=marqueewidth+8
6 H6 J" P! N' ~6 sns_marquee.document.write(marqueecontent)8 t* O& E/ [1 }
ns_marquee.document.close()
1 l: M f2 I$ w2 @/ \/ @actualwidth=ns_marquee.document.width
* Z/ O, O3 i c% n& Q) w" X4 v! i} w- \9 d6 Y! \$ X# y" n7 G9 U
lefttime=setInterval("scrollmarquee()",20)( Z% i5 }8 V& c* I- V ~# v
}
: F) H% ~3 b% Y4 O0 a4 l& l/ P% ~window.onload=populate
' n; R: e- f/ D9 o- O7 D' L+ u6 b8 t- ^- k" }
function scrollmarquee(){
. `# I$ G9 }8 |; d9 ^if (iedom){: W. ?1 G* \/ [( p1 ?
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 l6 G1 O+ ]' ?9 C2 w* k) m, `
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed; E5 i& h$ ^) k- p! p* L
else
* o4 E: u3 M3 @' E; Z* J rcross_marquee.style.left=marqueewidth+8
# a+ \; R0 d' P6 L" s1 [, p( A% ?1 c$ t0 y* T0 z8 G/ x9 ?4 X0 y
}$ ]/ M9 j( a/ o( n2 h4 m
else if (document.layers){
; o/ s) F- D& [2 I" Qif (ns_marquee.left>(actualwidth*(-1)+8))
( ?: V3 i7 h9 `( bns_marquee.left-=copyspeed
$ o8 ~% {( F9 a P, }+ Y" i5 l% melse
8 f9 m4 w$ B8 [1 q& E4 \ns_marquee.left=marqueewidth+81 ^5 G \* |* m+ v1 N3 x
}
6 u4 ]$ r4 B4 C) e6 r9 s}- y7 C2 g2 e( x3 a) O
" L4 c) D3 S5 E* Q% ~
if (iedom||document.layers){$ ~6 g1 ]4 {: U5 L' m6 G3 C( Y/ d
with (document){5 @+ X7 s0 ~# H+ d' q! @
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
' `3 a. ]% F/ j; k0 ]$ j+ N1 [! dif (iedom){
% W% N% Y+ {2 b$ }3 p1 K" C5 pwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
$ }. |+ q f; v% u# ?4 qwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
0 l. F0 I5 i2 W7 Qwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 W! f& G7 ^$ v. P9 |2 O/ Pwrite('</div>')& h$ d; _3 {9 Q _
}
/ K/ h/ D3 j M) r" N0 Zelse if (document.layers){
! f7 L& B# p9 u, ?" Z" N! p% Jwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')2 P$ v7 Z5 \& {! |
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
5 |) m3 m1 ~% @$ N* G4 Q/ qwrite('</ilayer>')6 e% k' b, i" E2 R
}: w" U% ^& j- ^! y; v7 S$ ]
document.write('</td></table>')
2 H: m4 k$ r4 s2 n& o}7 ~( a6 O }6 m3 b# v. z/ ?; f
}. z' ~5 {0 h! C7 h3 o0 r
</script> |
|