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

|
网页之跑马灯文字特效
//修改宽度
* C7 l5 u; J! x* n! Ovar marqueewidth=3001 J# ^- g3 b- V9 p: q; C6 h7 ~
//高度7 D9 D/ g0 k- ~4 i
var marqueeheight=25
: b! x0 e E4 f: c) X/ v//速度(1-10), s4 f# V3 F W* e* ]" q
var marqueespeed=3# @5 g: u9 r- [
//背景颜色
. A: \$ y. q# u% a6 Y; w3 H0 Q( @+ }4 dvar marqueebgcolor="#FFFFFF"
/ ~0 C) ^1 u& s: e/ H) M2 n//是否能暂停 (0=no. 1=yes)?! y- I- P+ t+ \. z4 W2 q: K
var pauseit=1
# s0 ?: D( U' @6 N' d
- y, [5 x# f0 V- W- ~" r& V0 u//修改显示内容
$ k4 h5 o# @7 E6 ^5 }5 o8 B6 ivar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'1 t5 d/ s/ B6 k3 Z) f9 r
; D: A) v/ h8 y0 o
$ D6 r- U) c/ c: r; x
////下面不需改变////////////7 f) g( x/ h$ L. ? {' C
Q8 K0 B' ~, \4 }- c. xvar copyspeed=marqueespeed
) C* w% O; h9 B: W! W4 pvar pausespeed=(pauseit==0)? copyspeed: 04 |3 a' _% T! {" t+ @/ ?
var iedom=document.all||document.getElementById6 H' E+ V. t) y3 d3 q, N
if (iedom)
2 S, A1 v7 ~& d% D) _document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
& f+ g! \! }' gvar actualwidth=''" T: |1 v3 y7 `+ R, }
var cross_marquee, ns_marquee+ n3 W( o) i2 ] ?6 Y) h
! W6 M: l6 P2 i- F( U
function populate(){
) E: J# \* n- F/ E( B* @if (iedom){* b1 b) v5 n/ T. `1 R' W9 T5 W
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee1 Y" R9 j' f7 b4 q+ j" E/ R
cross_marquee.style.left=marqueewidth+8$ v+ d& @# s5 d5 r* f) q& f _
cross_marquee.innerHTML=marqueecontent$ o8 T+ r& K9 K* J% A' C# ]: k
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
7 R p* s3 ]5 D8 p9 w1 G& S5 G}
7 g7 S1 W- v" z. j, Belse if (document.layers){) q9 [ U! s0 k
ns_marquee=document.ns_marquee.document.ns_marquee22 l" N, C( M$ U, h C2 g( u0 u
ns_marquee.left=marqueewidth+8
; M4 E+ u( G( Q! [9 J" g# T: B9 fns_marquee.document.write(marqueecontent)- B# N; _ P( j& r9 A; U
ns_marquee.document.close()9 x, \' @' i) s1 z3 K: N" F5 v
actualwidth=ns_marquee.document.width }* S. X! U B! g9 M
}, \2 H& E8 Q9 G0 Y! d0 K
lefttime=setInterval("scrollmarquee()",20)
/ U' l( D6 S i \}
- a" E! D, i, y% Y& N: [( v1 S5 zwindow.onload=populate
|9 D+ C1 e1 _' d
* Z" D' N! w) q4 b6 Qfunction scrollmarquee(){1 n6 }- {, E& C+ [5 t
if (iedom){ J) x, @* Q4 `! E6 Z
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 @' t) i S! J+ F2 Q! f/ S
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
9 V. ]! T4 G4 n, I% M1 Helse. E( F$ M. G3 r5 P. l/ z. P. r
cross_marquee.style.left=marqueewidth+8- M3 u# E7 T3 j
* y9 p/ T i. x: g: g
}* P9 D" Z4 H5 x2 g" h
else if (document.layers){3 J; j8 C8 S0 K/ ~% y# I, n
if (ns_marquee.left>(actualwidth*(-1)+8))
$ V0 U( B0 k/ O; @+ I/ e7 L, rns_marquee.left-=copyspeed
8 R% A$ z5 j$ F) v# Delse! S; O8 ^5 r3 K7 h/ Y! ]
ns_marquee.left=marqueewidth+8
3 C4 d& x5 z& X5 U* v) u3 S2 t}# d5 o% P% a) R& O& ?6 p
}
6 |! `- `9 B8 x% `# y' M7 j( l" p/ g, M9 q0 m. t
if (iedom||document.layers){
; i7 k% L- `* J- {/ _# s+ s& kwith (document){* D9 ^; F/ M- }4 c" v# Z% R8 {
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')0 s" |9 ~2 z, [0 x% g. h$ j
if (iedom){
' `) a7 e' r5 V9 Ywrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ t% G+ }. _$ t, q: [
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
3 D( _( @( K, k# Vwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')1 r1 j# x% a$ j
write('</div>'), A. P. @% V9 G. x
}: K, _4 j* r- o' H5 ]1 o
else if (document.layers){
1 {, M) t% q$ P3 l7 Xwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
) q! L/ G7 n; \& Y" b( p; Gwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')8 |7 m, Q# s7 f) ]" X2 u- @6 N5 U
write('</ilayer>')
, v6 c* F; ^1 q; g% A5 t" N% U0 R}
# Y7 H7 f2 ^; h9 [( tdocument.write('</td></table>')+ k1 N) B7 r t
}6 s5 C* W! V6 g/ G; N5 O- f
}2 T. O5 u G! s0 m
</script> |
|