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

|
网页之跑马灯文字特效
//修改宽度- R. p5 v& ~9 h+ L$ J& A
var marqueewidth=300
- \$ ]& D3 D# s4 Q//高度
! ^- T' B- D w9 H/ F' ~var marqueeheight=25" U" p: }4 C5 _3 r$ e$ ~. ^7 p
//速度(1-10)- S& d, k6 M! t
var marqueespeed=37 _ o5 m. d( \- W5 a
//背景颜色
* A% f0 B4 ^( ]1 q4 q; mvar marqueebgcolor="#FFFFFF" o. I/ @% z, r
//是否能暂停 (0=no. 1=yes)?
7 \' j g- B, P+ Uvar pauseit=1
, N7 h W/ k0 i+ n( E( _3 p
' \, l5 L$ M6 R) q//修改显示内容
# z1 M, j4 ` @6 O; [- n6 z/ G( Avar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
1 j5 Y* ~8 `4 J1 O+ E* r4 ?6 G- Z6 h
{! \( m8 v1 G
: k [! j( G) @ B3 E. t4 a////下面不需改变////////////6 Y. P7 ]) M4 {& ^ k4 t
; y% n! B" c& M' o/ p$ Cvar copyspeed=marqueespeed
4 Y1 _, {9 ?5 z; {# Ivar pausespeed=(pauseit==0)? copyspeed: 0
8 s5 u' O r( @) d% lvar iedom=document.all||document.getElementById7 t( S3 e7 X+ C8 J. m
if (iedom); `4 n& B5 A9 u" [) q3 D/ V: \
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')( Y# a4 x0 q. k7 l g6 k& K
var actualwidth=''
6 K/ r- S( h3 Hvar cross_marquee, ns_marquee- b; f8 G# J& \( X+ e6 s- H
2 A, {1 D1 R' q) t1 J9 K
function populate(){
" R( h; d0 `4 V" o9 ?: F6 q. k9 kif (iedom){# g8 G/ @$ |. ?9 ~6 w- d1 n& t
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee& n4 D2 \3 d7 k( z
cross_marquee.style.left=marqueewidth+8
& W% p- ]4 N7 E# r- v, xcross_marquee.innerHTML=marqueecontent
/ |4 Z8 C2 R3 C D$ }actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
0 q: R* _9 o5 k8 q}; O2 h! ^1 D' a! d" v% t
else if (document.layers){& S0 d. ]8 Y" M, B$ k
ns_marquee=document.ns_marquee.document.ns_marquee2
n: b$ U' X/ ?" _/ Qns_marquee.left=marqueewidth+8
' W6 g3 D9 q1 I+ i# Ons_marquee.document.write(marqueecontent)
* L& D" ^4 h T. Z* V: e0 ens_marquee.document.close()' C9 e3 d9 d; D9 h4 ?! `
actualwidth=ns_marquee.document.width2 r6 R- r8 b! Y' L: V- J2 y
}
* G8 C) I" {% D9 v3 l5 Qlefttime=setInterval("scrollmarquee()",20)
7 M+ e( m/ l% W; P' R. o! S}( \4 [- h8 D* }" `
window.onload=populate
/ U+ J' X4 z1 @6 R" d# [! k! a0 ?4 F, p4 P6 ?; x
function scrollmarquee(){. K; S( T% b' A
if (iedom){
2 k( P* p7 O: E. p* cif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
. h* N$ S8 q5 [" r1 b! I2 C; `cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 b" o2 H2 Z: f. |3 z+ t( h. j( F
else
4 g5 |9 I; x& m5 j$ p( d5 Scross_marquee.style.left=marqueewidth+87 Z- [8 L1 S0 P
# P4 Y" ~8 F* L$ f7 _ _8 \+ g* I7 O}
$ n- J& [$ E& ^! E" {8 Y' @+ _else if (document.layers){, Z% [6 U" \3 g, d7 z
if (ns_marquee.left>(actualwidth*(-1)+8))
4 `8 k5 M; M% i0 dns_marquee.left-=copyspeed4 n+ \+ u4 I( `' Q
else
- }# G7 b& _0 Fns_marquee.left=marqueewidth+8
7 i: e3 o! G7 Y}
2 q- }5 K5 v! c: S4 y/ `}
& B4 N; t2 }; _0 J7 x8 q
. L: @) ^( R: A# u% N; lif (iedom||document.layers){
: M8 h! T( `1 i+ Wwith (document){
: o) _" M% K" c( I$ U8 Z# t" kdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')- I: G; V" |& Z) X
if (iedom){
. p- X& J' G3 L; `write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
' Y- h8 q4 d7 e! i kwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
* k+ f0 ^/ }: Y1 K/ K0 ]write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')- v: Q6 I! v3 u
write('</div>')' S0 u2 T3 g1 _
}. G; Q( |1 u- _1 D- R
else if (document.layers){9 x N) J& {- V! h1 |% t! R/ c
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
' u8 ?/ s, }+ T* `) P' nwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# M' F4 S& H; C. z: Gwrite('</ilayer>')
" N9 L2 l+ ~* D. X}
0 l" |8 S* b$ l {% bdocument.write('</td></table>')
' l4 ?' ?3 T$ e, |3 J( l}
0 l5 B; a1 O( W) s: l}
) P$ ~( S4 {4 t% F6 ~9 d5 W+ T" v</script> |
|