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

|
网页之跑马灯文字特效
//修改宽度
. Z$ x* d, S; t1 fvar marqueewidth=300
1 r% ~% }( u' |1 E; p; B//高度
5 U2 K) O; ?7 K6 S5 f# K7 F; Nvar marqueeheight=25' }/ J3 x2 j+ _* |2 K$ H% O2 V( h( G
//速度(1-10)
/ t% l3 o0 d7 U* {var marqueespeed=31 C j+ q/ d! A, a0 Y
//背景颜色' {) H- p' t: q+ h- B) n B
var marqueebgcolor="#FFFFFF"( L z; v% C2 c& v& f4 e( Z% Y0 \
//是否能暂停 (0=no. 1=yes)?
* u3 a6 G9 v( N# J8 E1 I+ ]; ?% Lvar pauseit=1
$ @( G. Y- l8 F+ u( |9 O9 q
' U+ U7 C1 T: M( S5 @) [//修改显示内容
% r- \8 s2 N9 g' W5 A/ pvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'1 U ^" u' `& f( n
; p5 I" l* Z8 T( z# Z2 `
1 H; [. [8 f- o0 v7 H+ G% W////下面不需改变////////////
" s* e9 \" x) Q( P, L4 T0 T7 U( x8 f* N. X0 _- G' T) l
var copyspeed=marqueespeed% L* _' V# {. M! \
var pausespeed=(pauseit==0)? copyspeed: 0
+ y, \6 N- G+ W/ [* {var iedom=document.all||document.getElementById" z7 V& d9 h1 H* r: p
if (iedom)" Q) Q+ j8 ?$ m! P- C/ _- C# Z6 N" w
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
+ O2 F* i) P8 i( U Y9 mvar actualwidth=''- G e w; u* Q% e
var cross_marquee, ns_marquee5 {! C( t% s, d* z- q# b
/ b" o# s: M/ X5 [
function populate(){
. X9 o8 U$ I5 G- Uif (iedom){; w& E" Y. ]& ?
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee b) {, Y% {* W7 x% @( m* E
cross_marquee.style.left=marqueewidth+8% {/ W% ^. ]) E& \2 w0 p
cross_marquee.innerHTML=marqueecontent) X4 D, N5 Y" m: I! O
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
5 ^2 \" `6 Y2 _6 B, d! T- y' l}
4 s$ {3 ?& U! L# `+ y' ?+ K1 Helse if (document.layers){
, z5 |! E- ?; Dns_marquee=document.ns_marquee.document.ns_marquee2) ?; M/ X* c( J( f/ R& U$ w
ns_marquee.left=marqueewidth+8
2 f3 V$ T: ?; i* }: d- @ns_marquee.document.write(marqueecontent)
" @: J3 l8 T+ a2 Y$ Pns_marquee.document.close()
* k6 l- c/ T! C2 }% ]6 K0 Lactualwidth=ns_marquee.document.width! i0 y8 ]2 c: Z! J7 r
}3 T: [6 {0 \- a# m4 Y
lefttime=setInterval("scrollmarquee()",20)
; y; d5 ~3 x+ B {5 `. [}5 i1 V+ V: b: C3 k! J9 C. A
window.onload=populate
5 e1 t- l6 a/ b- P9 M8 P c$ O" S) H* o2 l
function scrollmarquee(){2 A# w1 U! w: [( {9 P
if (iedom){9 O2 s+ j# d% D; y4 Y- j- H6 b9 w
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
% N; e! j0 `( L0 |3 ~cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ F3 t" l6 L, S. u9 u
else( d Z* _, Q+ m, Q
cross_marquee.style.left=marqueewidth+8
! l2 b/ ^4 p" W% r' r# l6 e$ V$ w7 S3 n7 y, k
}4 q& [0 C* `# U4 F" ]/ M9 i4 F
else if (document.layers){0 W) O9 g- U5 s, i
if (ns_marquee.left>(actualwidth*(-1)+8))5 n& o0 j" a" p6 P
ns_marquee.left-=copyspeed
. s, n; e7 T, D/ v; j8 Y& U2 Velse( C7 l. G( j; C3 y0 F( w: L* U
ns_marquee.left=marqueewidth+8
7 ^8 P. X# b& N4 K. d}# a) R3 j* A; z* k/ L
}
+ H1 R* g. G$ G. k9 G1 u* y6 W. r5 m2 Y4 g2 @. @9 B9 ^
if (iedom||document.layers){
" p/ ^# y. j! {# r; Uwith (document){
9 {2 y6 B3 d/ ~document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
' Q7 k; `, j7 B7 q+ y8 uif (iedom){
5 G2 {" z+ N: p' V0 q1 swrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'): w/ X0 ^/ {* \3 _
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
6 u( Q* r8 R" _0 p7 z; pwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 S1 P" W$ E+ P7 owrite('</div>')
0 T, Q; z" ?: k3 w4 t. E}
+ Y" @. a) i, F/ C/ o1 {else if (document.layers){
- Y) P, q" ~- V; J2 h) i1 ]write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')7 Q( U) K6 n! C: a, k: z
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')! r# M0 X8 @1 U, D' l/ z. x
write('</ilayer>')( v( o* {- b3 \$ ?
}
; n) J Z, K- E- ?document.write('</td></table>')- o; ~' d9 b2 e1 t) J% n( @
}, t' h: t5 y" Y
}
G5 c' \, X* o</script> |
|