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

|
网页之跑马灯文字特效
//修改宽度9 o' X% y! d& V3 U, p5 V
var marqueewidth=300. _1 d3 _* h6 j! V6 C- C
//高度# u% ~+ N: o8 y3 P4 m" e
var marqueeheight=25* Q/ a* s$ E, Y, r8 w8 X' ^
//速度(1-10): J0 I) {0 h7 o I1 Q, _1 X
var marqueespeed=3
8 z1 J/ d+ g/ \7 Z7 i//背景颜色* A9 i6 j1 ~) j ~/ B/ r! V
var marqueebgcolor="#FFFFFF"
4 D6 E6 o' S1 T' L' q//是否能暂停 (0=no. 1=yes)?% m3 ]5 O. d6 [9 Q
var pauseit=1
, c9 p9 b5 c5 a6 t
( c) q4 L2 x/ }! ]//修改显示内容! N. ] `/ j5 O& m6 Q8 a
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'2 ?; ` _. q3 v( G
d& a$ z" s1 `: @0 w" `5 |( W6 z7 B, M0 ^; Q
////下面不需改变////////////
' `- q* o M* M% Z% _/ V" q0 i2 j% Z. Q
var copyspeed=marqueespeed
* d; j3 W! z# Dvar pausespeed=(pauseit==0)? copyspeed: 0* V; X4 z1 T8 Z9 p& A' j
var iedom=document.all||document.getElementById& P- R) A: @$ |/ Y$ X7 b& w* `
if (iedom)
2 ^0 f3 |: }( ]- W$ s+ M! t! Ldocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
" B. A" l* w2 w9 N6 L X) hvar actualwidth=''* r# x& l) M. t |! E
var cross_marquee, ns_marquee
5 h' D% G: R) @1 {* Y: _. }9 i7 w1 e; h# b
function populate(){" N7 m5 i& }. ]5 J* K
if (iedom){6 O* g' z- ~1 w9 c* t) `7 Q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
* _6 m$ a' e; across_marquee.style.left=marqueewidth+8
X6 S6 |+ M- d6 {, C$ \5 hcross_marquee.innerHTML=marqueecontent X- t! z! W+ D x) z4 Q
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
# Q9 y# J) J$ K6 ?6 x' W, r) }5 i}2 y" b* s: ]9 I, a& V1 S
else if (document.layers){! H4 |+ n, g( M* V% n
ns_marquee=document.ns_marquee.document.ns_marquee2* F% A; w* ~4 Y: o( q9 V: z
ns_marquee.left=marqueewidth+8
6 `; A2 @5 L) X E: O6 K! j5 jns_marquee.document.write(marqueecontent)
+ O' x5 f: t, W' Qns_marquee.document.close()
" w& i+ ^, h" ~& v: |+ y+ b9 Eactualwidth=ns_marquee.document.width
( e1 V* L$ A$ _* C. N}
3 _) e" u- Q) [$ h } T# ~lefttime=setInterval("scrollmarquee()",20)
! c5 V- P: v: I$ [}
! r- K; F5 O% }% a# ~( l/ C8 Lwindow.onload=populate+ q! m% w3 R6 N! @ B" t
# U2 ], j/ s& H$ S% c) O! [4 |' P- N
function scrollmarquee(){' w% F1 e2 H) q/ W# ]$ q F( D
if (iedom){
8 D8 [0 A% w3 G. Zif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))- t" Z+ g& ?. y" Q2 @7 G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
`5 u# w, { u: Eelse& S* Q5 ]7 p! v8 ]( U
cross_marquee.style.left=marqueewidth+8
# J: A k6 G8 o' a, j# |; z& ?, d" J' `7 ?6 [
}2 {) p- `! S4 B6 N: ^
else if (document.layers){4 S# f# p: h6 g& d8 O+ q
if (ns_marquee.left>(actualwidth*(-1)+8))
+ ?' \! O9 I. J5 D6 Y; ens_marquee.left-=copyspeed
; |; l s6 o: a. {: ielse, N& y$ f. V5 q1 F% S+ P: @" q
ns_marquee.left=marqueewidth+8! W$ g- H! e; j8 V8 Z
}: D( F7 e+ I* {$ H. z( S
}) _7 x. L- Z" Q8 r3 m
4 D" R: a7 e$ ?# p5 m1 G5 M0 Qif (iedom||document.layers){
, _' U6 \% Q" R- M4 N$ \with (document){
% T, q8 C4 w9 g2 d% A$ ddocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
8 Y8 w3 P) u9 J* oif (iedom){/ @ m+ ^# t) T* K& X A% `, M
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
8 f+ D0 t; [! U+ n& X0 ^* Hwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
' j/ r! C+ ]0 j0 g' Cwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
s& d3 u2 M2 V, J: u- [& ?4 xwrite('</div>')
+ j3 W- l2 |* o, I" @- G}( h( D& |; w& B+ M! K2 Y
else if (document.layers){! p& c0 r: O; a7 h, i: s* D
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
% f' i' f: n8 \3 d# D! Jwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'); S' p3 O( | {$ r
write('</ilayer>')- e5 P1 x" |$ |" K3 U4 w1 r
}
! F3 o- A \- M" j' S" r } w. X! }document.write('</td></table>')+ C' Q3 \# S/ m8 m* R, p, Y0 h9 J
}
$ u* r1 G8 U9 o+ A& g: l& k}* X1 U/ ~5 D0 C
</script> |
|