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

|
网页之跑马灯文字特效
//修改宽度2 S2 M* {) F; k$ f# m; X2 X
var marqueewidth=3009 |7 ~/ y' Y. Y* g! x8 A
//高度
+ \/ P) y0 u! c6 k! |var marqueeheight=25. z6 F0 A2 r4 S
//速度(1-10)
2 A- _1 e) p" _: M4 S+ Jvar marqueespeed=3
V8 \# {7 @, e//背景颜色: o7 j# }& {7 t; G6 {% \
var marqueebgcolor="#FFFFFF"
% A( {3 m, A2 h: Z# Z) u//是否能暂停 (0=no. 1=yes)?
4 B: f( q: p0 Q5 nvar pauseit=1
9 w0 d: c3 F- x; A+ l( s) Y' n- a$ @0 @
//修改显示内容
! A6 r/ o3 [; @var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
$ e6 _9 v1 Q8 }) o8 [: h! a, [0 w- v% [( H2 O5 W6 T# r
- r; L. Z7 u- F: d. ^0 K////下面不需改变////////////4 ]" @& I0 {. }" N; _3 [5 Y& L
" d! ~' L. Q- K6 R0 D& ~5 kvar copyspeed=marqueespeed u2 m, o& H6 E8 J
var pausespeed=(pauseit==0)? copyspeed: 0
7 K, `$ c: X' D: A' x* }var iedom=document.all||document.getElementById8 Y2 Y2 h) W6 b
if (iedom)0 O, f# N. T2 A* A9 @% C6 m) I
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
% O2 Y8 H# }1 u% ^0 ~var actualwidth=''
3 U i+ n: u; Z: G+ g8 bvar cross_marquee, ns_marquee9 k7 K, `. K% ^
" t+ U5 Q) z; s/ I9 bfunction populate(){8 w/ ] }( @' S, Q* j
if (iedom){
' `# p+ M, o2 O: T. A; S" jcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
* Y& {3 T3 k8 s9 }3 C* U% Lcross_marquee.style.left=marqueewidth+8
|6 u& O3 O% h; H- \: \$ J9 ecross_marquee.innerHTML=marqueecontent; v) M) X5 ]1 r0 A/ a1 k) {
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth- s A2 j$ H; Y0 N" Z% n
}8 |! v8 j/ y/ g4 h
else if (document.layers){
9 s2 o2 Z/ j1 B% C$ Sns_marquee=document.ns_marquee.document.ns_marquee2
5 x7 G9 q; H+ u' l2 I6 ens_marquee.left=marqueewidth+8( b3 s! @4 ^, Z& V1 j, k+ U
ns_marquee.document.write(marqueecontent)
+ b/ v; L# _( N8 Q% N. A* ]( Uns_marquee.document.close()
Q' N" v& ?. E" H9 kactualwidth=ns_marquee.document.width& g& a! c+ _( o9 m n
}
( [3 [- _# J( }; K! m1 i( `9 _" Nlefttime=setInterval("scrollmarquee()",20)
8 {6 d" j4 i0 Q2 F) k& ~' E- I0 b8 V}
5 [( X& o8 [0 y" d/ nwindow.onload=populate( E, ` e1 R) L! U: i5 Z! I0 d% s- G" m
; z& c) F2 ~& t* B+ z
function scrollmarquee(){* `2 c# h0 j- e" V: ]+ a( g
if (iedom){
& p7 l; n% {8 y; tif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
6 y) Q6 y( n+ \9 f; z$ dcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ w5 G6 o& x3 P$ [- {& r# a
else* r6 Y& M% e, }' h; D: y& n
cross_marquee.style.left=marqueewidth+89 i" t$ {0 J. {( f5 v9 P- N
8 R) |9 D3 I& s! o% V
}" u% M/ T$ c7 p6 A) `6 H5 E0 u
else if (document.layers){0 p& K6 K- M1 A& Y/ g' g
if (ns_marquee.left>(actualwidth*(-1)+8)): Q& \+ w, \% D
ns_marquee.left-=copyspeed
l# ?: d) A- ?( \5 y- y8 w8 |else
$ H' Q# u2 x c2 `. `ns_marquee.left=marqueewidth+8
0 @$ p/ ?3 n9 J; N}
! h0 z" l7 a' s( Z9 T: _6 w}
0 E$ Z& o4 N; {" s' j y* k! z$ W* j# g, y% v9 n+ ?1 G
if (iedom||document.layers){
2 s) \- C; @. X7 Y+ c, o% N1 Twith (document){
& L) [) a( A0 J/ O1 e% W5 Kdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')( H' K. a7 E' Z; w
if (iedom){
y$ S: y0 a0 }/ x8 G# B/ dwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')& c1 g3 q( E5 j. b
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
: P% H$ Z- T' V1 E- t* u: ~8 n) k5 X F7 _write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
3 p! h! n# R; Swrite('</div>')& B5 S U6 O8 J; `& q
}
; K8 ^, h1 M5 \* Q. U, H" P4 ielse if (document.layers){8 g' g) h B. i* M' T' P
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
# F0 J, {' |) qwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')% G# J2 R$ b; Z
write('</ilayer>')
# z* o# |* b& [( }9 @! Y}
3 T1 v! i# A/ i! t7 s" g& U4 w& Vdocument.write('</td></table>')1 t. b! ?! V, {( i% a
}9 l6 J, j/ |, m0 k, L
}! ?& W; }* p9 B4 [: U9 b
</script> |
|