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

|
网页之跑马灯文字特效
//修改宽度; r4 B& R( m" r' }' m4 Y
var marqueewidth=3009 ]' I' V0 s7 K
//高度
" q2 C. o" e* N. F R! C& m3 q0 Z1 pvar marqueeheight=25
$ R8 P1 B5 z; K% X//速度(1-10)
. x- n7 e, Y. f( h G+ Uvar marqueespeed=3
) P# Y K- f) b( R. V//背景颜色
. C6 P8 b; c/ H; cvar marqueebgcolor="#FFFFFF"
( @4 r$ |" `8 R* }0 L/ x//是否能暂停 (0=no. 1=yes)?$ m: P, y( P1 n p( r( y
var pauseit=13 o* [1 F$ w5 O( T) g7 ` V
+ ~" a: @1 o( e% G//修改显示内容1 a8 c$ c$ _8 i
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'% X0 ~. `+ F% Y! }
( Q1 E! v) {; X$ M" e0 r
+ L+ I+ I0 B% M////下面不需改变////////////
6 s: D3 z A. I5 ]+ T' ]" Z; v# S' y g% y0 l) S% C6 C
var copyspeed=marqueespeed
4 M6 |( ~, j, M& B0 N4 N* L( [var pausespeed=(pauseit==0)? copyspeed: 0
. }1 U$ k, V# B& l) zvar iedom=document.all||document.getElementById
/ o+ R1 \% N9 H& \ [( @9 r F; Tif (iedom)" C" f: d4 R# y0 G0 \' ? @
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
: M, q* a: b" `) d. o/ avar actualwidth=''2 I: u. Z% Z0 E' I
var cross_marquee, ns_marquee5 @; U- p9 s8 R5 Y/ v' W
+ C0 `) o' e3 X8 }' _
function populate(){
2 F, W& G5 C/ B& Cif (iedom){, h: d, f. G! v
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
1 K p# {- o$ P8 \% ccross_marquee.style.left=marqueewidth+8
$ a/ A6 ~' r3 P m4 G0 u# Xcross_marquee.innerHTML=marqueecontent
' y5 d6 y2 u0 r9 N3 j8 C C; R" `actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth9 ~& C5 j; y- g" d3 k
}# s: T! b9 p' w3 N2 L
else if (document.layers){
8 Q: a/ m. H @$ Mns_marquee=document.ns_marquee.document.ns_marquee2# L ^/ A( ]! W6 C9 t
ns_marquee.left=marqueewidth+8
) v7 n6 Y/ |( b. wns_marquee.document.write(marqueecontent)
4 N0 F+ q% C/ p* s- t" Vns_marquee.document.close()1 L3 D1 t+ |) |& [' N- ?0 X
actualwidth=ns_marquee.document.width5 y3 V8 R4 Q5 l. K
}
1 _- f% j0 f5 h: Wlefttime=setInterval("scrollmarquee()",20)
& q3 R+ I$ R: E/ x3 M1 l; ~} T/ [) ~. u2 h; R
window.onload=populate7 u: R. z& v0 e; v3 b+ H
' u. [) I! L" U# M
function scrollmarquee(){
2 o3 v* U( u" r8 C- f0 c4 k- ~) E2 tif (iedom){# r2 P k" J g" H: G0 \ L; E
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
0 s% f# f0 x% q* ~cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed' ^6 v6 ^# z: l$ N* Z/ F9 W
else+ ]3 D8 ]8 l1 l$ b# g/ g
cross_marquee.style.left=marqueewidth+8( d" M4 \+ h3 z, p) V
4 x: F4 ]9 f( |5 y: U
}1 T) A( x7 b% @3 U) {' k
else if (document.layers){
S3 S5 |0 R" xif (ns_marquee.left>(actualwidth*(-1)+8))
8 Q" l( `$ q) m; _ns_marquee.left-=copyspeed7 Z& j6 q* q" G* U5 g
else! h3 e2 r {" S- ]3 r
ns_marquee.left=marqueewidth+88 B A& d5 [; |# }
}5 Q: m& V6 X6 _% U! @
}
( d O& }# B! P: e# ~2 z2 f6 F' `
8 F0 E- K" g) y8 D; qif (iedom||document.layers){. n' S! @( z7 M( a5 B
with (document){+ c5 n8 a' R7 g* A7 Y$ ~
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
. F) ^7 k2 @9 V1 d) nif (iedom){
6 y! e: ~, l2 dwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')2 u2 w/ J' B" c
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')/ m" [. w; j& X7 l5 x+ S
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
/ b0 {( d4 h! R! H; Fwrite('</div>')
$ ]9 M$ g( d2 l2 m+ p) K/ ~' M. L) f5 y}, L1 T5 b/ F, K3 ]/ a1 j$ w
else if (document.layers){
# i* |/ [% w! S# T6 {" C5 Xwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')( u8 x3 H. T2 {- ]$ c
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
2 S: q3 K" G% \write('</ilayer>')
3 d# B: q$ o( _" r0 I3 |}
- n' n3 h4 I. r1 l, Z& }& Fdocument.write('</td></table>')3 |) L7 @- Q# i5 E$ r3 R; T
}
, R' q1 Y8 L5 L6 F+ r}2 f+ ]: C3 v9 R/ _! \
</script> |
|