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

|
网页之跑马灯文字特效
//修改宽度) c# z: t% Q, M9 o
var marqueewidth=300
4 e L& M) D; R6 ~6 D" ^//高度
& z7 a* }, ?1 e6 nvar marqueeheight=255 s$ T9 q" ]! L5 q' B
//速度(1-10), i0 t0 c, N1 j
var marqueespeed=3. x; ~9 L# f5 e' L+ r0 W5 h' A
//背景颜色2 _" G9 y# b2 T# P$ f- [) ^
var marqueebgcolor="#FFFFFF"
; q) A- k) h( c2 j8 B5 |6 S5 K//是否能暂停 (0=no. 1=yes)?( D% v! ?7 }- }. y+ J! J
var pauseit=1
6 V9 U$ _1 ]. x K( _
! f5 J$ U b) d//修改显示内容9 J7 Z6 ^7 V+ r, g& u
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'* W. i' M+ j* U5 }0 z& U
# P& F! B0 i) u/ ?: Q" t( O- }# X2 }* p7 r0 t* e( ]" f
////下面不需改变////////////
+ G7 j: l8 W& x; f) ~. ]+ K% G5 b X* A" p3 _6 A% n
var copyspeed=marqueespeed _ V$ G1 Y; i; A$ C
var pausespeed=(pauseit==0)? copyspeed: 05 }0 B6 k7 H9 Y+ Q
var iedom=document.all||document.getElementById
! B8 V2 j' ^+ J* K% ^if (iedom)
, H3 g( R5 a! }- P# Mdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')& B; \2 d! P& r
var actualwidth='' Y( k/ t! M6 N- d- N+ @2 I
var cross_marquee, ns_marquee& Q9 i" W, C9 t5 }! f0 J
) Q6 g/ n3 {2 g1 M& U. w. \' g0 }function populate(){8 A# \' ~# u: u/ e" F. O- a
if (iedom){
6 f1 |4 R) S1 Vcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee( B/ P* i- | y0 m
cross_marquee.style.left=marqueewidth+8
! Q8 F ^" E5 [5 M$ _/ ~& k8 vcross_marquee.innerHTML=marqueecontent( x! P! \9 p' D7 D' S7 w* |
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
6 b$ |7 B7 f3 i4 a7 o}
) M3 @' \3 d% }) M+ r) Relse if (document.layers){) P% X; A- a$ l1 g
ns_marquee=document.ns_marquee.document.ns_marquee2
& V W4 }% ]0 a' Nns_marquee.left=marqueewidth+8+ S1 O0 d4 Z% E6 L2 y" L2 r
ns_marquee.document.write(marqueecontent)
& q9 Y1 ~3 K1 a: B: yns_marquee.document.close()' F1 h! R5 {, S0 j r) g* f+ Q* h3 h
actualwidth=ns_marquee.document.width
& K4 L G% @, z! \ o/ g9 a}
1 w9 v- }# j# K) v {! ^# _lefttime=setInterval("scrollmarquee()",20)
) \- r- ^- r! q# W n4 B}% Z/ O; v7 x j6 q! f4 I, l. e& n
window.onload=populate# E$ v" `0 `7 j# |2 p" Y
$ m8 |1 ~; t' V5 C$ U; @$ f5 U: `
function scrollmarquee(){
, O2 p# H' O; ?" gif (iedom){
# |0 ?7 i# P2 I5 w6 @# Dif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
9 Q. f. h& k$ wcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed4 W- [2 V3 S/ l2 E( j5 }. w
else6 O* |, r+ ]" M
cross_marquee.style.left=marqueewidth+8
8 \' v; q5 K+ G' Q8 p5 ?1 ^+ m0 y0 B h1 \) d0 T
}3 }: h6 E- ?% U B
else if (document.layers){, f0 x+ c! Y. i/ H4 d
if (ns_marquee.left>(actualwidth*(-1)+8))
/ B. g1 z! s+ C; J+ }ns_marquee.left-=copyspeed
8 J7 u9 A0 i6 y& b: W6 ]/ v( belse" W& `* [( g* p$ V( Q5 |
ns_marquee.left=marqueewidth+8
, J+ k$ R1 A( T}4 v1 H) O/ Q3 u' Z/ D- |
}% K! n# K: U) [2 ^7 j- I1 h
' }9 x3 g/ o; _% L! ~if (iedom||document.layers){
" X) K6 q' E/ Dwith (document){! s/ v8 Q; K$ d; z' ]
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')0 X: K6 w0 G1 z8 P, |5 v; @
if (iedom){) F0 D5 s+ b, Y3 v
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'). {! j5 m: I! k2 A
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
$ U4 X7 k8 g) \9 S6 l0 d- mwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
" q, Q4 h% @0 D0 c* rwrite('</div>')
; ^ ?5 b; n$ O: v' v \) O1 l$ V6 E}3 h/ x+ g5 v: s% i8 }
else if (document.layers){
+ f% q g+ o! d) A# _( }& R$ gwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
, V4 B& X. Z ]5 f- t. Rwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'), o3 [/ O y$ j+ Q/ V6 n
write('</ilayer>')3 |' n7 F! ?& m$ c( E. ]+ o6 p' x+ [
}
4 M5 R" V# K4 f$ W+ T/ odocument.write('</td></table>')7 q' F/ x+ z% \2 F' ?
}
! y; n5 n9 h# s% m5 j' d1 D}
: a; \) Z- i4 d7 ^( b: O</script> |
|