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

|
网页之跑马灯文字特效
//修改宽度
4 I, d+ g% k3 C2 Tvar marqueewidth=3005 `" @+ M$ F+ S8 y0 j" f
//高度& n: E' S/ `6 o4 l5 O7 ]0 r, @* o5 z
var marqueeheight=25. ^3 |' I3 u* p( d
//速度(1-10)
8 W! u6 o! ^. T: x" Hvar marqueespeed=3
3 A: }- O p- N' r//背景颜色2 a Q2 @/ H' r1 @
var marqueebgcolor="#FFFFFF"
" e9 d' S$ d, @( l" q% L) A' |! G//是否能暂停 (0=no. 1=yes)?
0 H1 }1 Q3 U: M- S6 ^var pauseit=1 [0 N* ~ U8 v6 e9 E
- E( R7 B8 F* r4 a2 U. J0 G1 D
//修改显示内容4 E3 p3 e4 }) N7 a: h. Z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
7 P2 f | P8 E( ?( |
) h3 u0 {8 g2 M+ W; |! H+ n4 ]( I& D
////下面不需改变////////////
; v3 F4 G( H9 w/ B" Q
. k" D; I9 ]$ [- V+ cvar copyspeed=marqueespeed
+ ]3 U6 J# g& n7 avar pausespeed=(pauseit==0)? copyspeed: 0- P, g/ ^" R! O' O
var iedom=document.all||document.getElementById
% H. n+ D. m% ^7 \& ~* Xif (iedom)
' P. ] h$ u% J" K, Pdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'); E, M3 C( Y% s/ A' y/ z) J7 z
var actualwidth=''7 q& x, h. U! x, L+ Q5 D
var cross_marquee, ns_marquee5 \' F5 N% `1 h+ W6 F1 r
# P- B( I# B) B; s5 R
function populate(){& _' m B' P! N4 Q+ N
if (iedom){
# w$ w$ o! I% {1 b0 R: fcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
5 d# ^* b- i5 |, hcross_marquee.style.left=marqueewidth+8
$ ?6 V. H. S; \9 c( [) f, Bcross_marquee.innerHTML=marqueecontent
; v4 `; ]2 Y- l {actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
. I; w/ s% | s, |+ A9 ]; y}1 g- ^8 S% s, j
else if (document.layers){& `3 F* y# q" g6 U8 w
ns_marquee=document.ns_marquee.document.ns_marquee22 W7 q+ V3 C5 ~& g! |8 s
ns_marquee.left=marqueewidth+8
8 I& ^# _$ }% m: y' @: k8 ?8 Q7 Rns_marquee.document.write(marqueecontent)
" z( P! s. G! ~2 d7 z% K/ F( k# Wns_marquee.document.close()
) q( f6 \' t6 Z5 d* \, \' vactualwidth=ns_marquee.document.width# @0 G8 s) Y4 R3 O9 T8 [
}
: {2 c3 y' P3 C- t$ q% Slefttime=setInterval("scrollmarquee()",20)
! d8 Z; d2 |7 R/ i7 w}
4 @1 h7 @2 p* {. `* s0 @( h; pwindow.onload=populate3 D9 S3 U; q8 t* m0 \0 K) R
9 K8 `7 M4 _3 \. t$ _
function scrollmarquee(){: V' m9 Y; A+ W/ s2 c* p
if (iedom){* [( ` ?, p H( m
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))& A1 `4 S3 ~6 C; O& {2 [& u# L
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
. J0 U0 {$ a: B( o/ t5 m9 @/ belse; G& ^' A G' ~" j! G( v f, `
cross_marquee.style.left=marqueewidth+81 d8 q, v/ m8 _8 \0 z1 m0 i. K' I
1 K- Y7 u7 Q+ i& g* X! o& p4 |4 x" X8 C
}, H( t# g8 V( } J8 E) K
else if (document.layers){ ^/ x T- J1 m0 K
if (ns_marquee.left>(actualwidth*(-1)+8))* }9 B) U1 e5 b% S4 }! ]
ns_marquee.left-=copyspeed
[! e, Y. b( k& d4 Jelse. G2 a0 V: J0 O
ns_marquee.left=marqueewidth+8
0 b) H7 q% O2 l6 H. Z0 Q}" S* V) n2 s: Q6 F5 z
}: f- `, O- c3 G2 |3 K4 D" N
6 g6 m4 i( J3 a: J/ M( W' xif (iedom||document.layers){! Q$ i) z+ f* J3 e3 O
with (document){
9 O5 D% G6 X6 Z4 e% u4 edocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
, Y2 K2 r$ ?$ o! c# ]4 yif (iedom){& [5 e+ i* V- m$ ^ J, X. Y$ i
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
# L& m8 _; X' |" X- W+ Ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
2 p% K' w" R& o; ewrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
! K+ x- K- j% J) E- iwrite('</div>')
9 K. p# g+ V! q# ?+ ^3 R, m1 [}
: ~2 e" x8 b5 \8 l3 gelse if (document.layers){/ p2 \! @+ ~9 O( w# _! Z
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
+ B3 {) a" M& {" a( J5 h( a. Lwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
+ m4 m% {, z( f$ o, l7 s/ xwrite('</ilayer>')
0 F" P9 |7 v- d% g- D/ i}
7 _# A. r2 @3 cdocument.write('</td></table>')
+ [3 D6 t& R0 ?! u} x" ?3 r6 V/ Z" s3 A) Y
}' K* u! k+ V: B+ ^" H
</script> |
|