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

|
网页之跑马灯文字特效
//修改宽度
2 H5 X, ~' X; O) b, L* C fvar marqueewidth=300& w0 \- T) `& `( e
//高度* U6 L, U' s* ^) t" N: y$ s$ ]. t
var marqueeheight=253 \9 }/ L- d" `+ ?2 i# ^6 H) e
//速度(1-10)
" |1 ~5 X0 L. E9 k, ~9 [1 |var marqueespeed=34 l* ^( b1 z6 U8 n0 m5 ?3 N
//背景颜色8 \5 m* Z5 j5 S$ L+ l
var marqueebgcolor="#FFFFFF"1 |0 O$ V( r* g# ~' ?3 w' u6 Z1 a
//是否能暂停 (0=no. 1=yes)?- C$ L. K) ~& l0 K. V" P s
var pauseit=1
2 i* X8 F" W5 o1 @: M, d* u' D3 s0 `8 ^* [* V: X1 K/ G( p* @. c
//修改显示内容
6 s: g; X3 | Z5 c- zvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
( h$ d" S. ]6 g/ R
+ @: G) Q; K$ `1 N5 Q' v( ]+ y( X) h9 O8 E5 T ]4 @
////下面不需改变////////////
7 {4 d* c) L: |3 B8 `- K7 f4 h: o
& `8 s1 m# ]. `var copyspeed=marqueespeed
* [1 N) ?4 ~' C9 e2 a4 u+ Vvar pausespeed=(pauseit==0)? copyspeed: 0( ?7 s! x* w2 O
var iedom=document.all||document.getElementById' o- I( u ]" b: |
if (iedom)
- s3 W4 Y8 L( edocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
( K2 ?' R0 v, S, Uvar actualwidth=''
8 ?8 A& A5 G2 o# i5 c8 l8 Evar cross_marquee, ns_marquee
* x2 u0 C4 p5 U' c( Y! M7 u! j- X5 d: B% q4 a
function populate(){/ w4 t8 \# I, w. D- c. e" o
if (iedom){9 d' m$ I' ]/ R' x; S$ s( u) I
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee# v$ _1 n3 B. Z! |, _2 x F
cross_marquee.style.left=marqueewidth+8
. J7 J; ~1 K4 jcross_marquee.innerHTML=marqueecontent7 A0 o& J2 [8 J6 M/ u3 s( F
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth- B% Y; a. d' c+ j! r4 O
}
' F1 K6 b) @0 B* _$ h/ h5 [else if (document.layers){9 c. E D0 l8 Z( S6 h, q
ns_marquee=document.ns_marquee.document.ns_marquee22 l, |6 G2 v3 _ |
ns_marquee.left=marqueewidth+8% R) }& _7 K+ g; [- ?
ns_marquee.document.write(marqueecontent)
: v3 w+ ]7 T R) e0 r+ q0 Zns_marquee.document.close()* H/ o6 Z6 Y& D' a3 S
actualwidth=ns_marquee.document.width& \+ |7 ]; {! T! W+ R) [/ F
}
! E& V( I2 A" Glefttime=setInterval("scrollmarquee()",20)2 v9 j& ^7 \: ?" X" j
}3 Q) y1 J2 s7 z: E/ g
window.onload=populate
$ ^* g! t+ ?) ^2 o7 |0 h) k1 ]- O3 P
9 ?' D$ ^6 ]. @: u$ ufunction scrollmarquee(){2 g$ `4 b' T# L
if (iedom){; }" N0 W8 l) i$ N" c: Y7 W& O
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
9 A$ L2 K! m) r9 M" ?cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed1 C2 K& L+ T8 z+ w* h) P
else
# ~, v0 m: ~6 h6 ncross_marquee.style.left=marqueewidth+8
* m1 ]/ A: l* x( o# @8 J z2 t6 F7 {8 t2 X7 N& g0 p3 Y
}: Y( P8 h0 N1 m. U% C
else if (document.layers){
& X4 ]# i/ F/ l+ u5 Dif (ns_marquee.left>(actualwidth*(-1)+8))
/ j$ J( x/ A; yns_marquee.left-=copyspeed$ z1 u* c: w3 U' |$ P
else
, p2 U6 A( s$ u0 h/ |ns_marquee.left=marqueewidth+8
5 P; j0 O v5 P7 j; G# r: x- g4 `* S7 ^}
& @9 B( ]6 {6 E$ C. f- B1 I1 @}; C4 G2 g3 l, n' \5 c3 |
9 R: I- R. w2 ~' V* ]
if (iedom||document.layers){0 i( W7 t! ?* ~- \) n+ l
with (document){. \/ n* E( N q$ I: T
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')1 n% f, W' R+ _! _: j
if (iedom){
9 ~/ {# y) a2 f: Xwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')8 F0 Y2 \: j/ j3 D+ F/ v
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'): [! y& l l/ l3 R! N+ z4 |) V
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')6 Z2 ~3 t6 Y3 Q$ b4 b6 u% [
write('</div>')# L! c) ]3 T# D1 V6 N! ]* j
}+ H+ E0 G+ l; V+ q
else if (document.layers){
; a7 B+ ]- [# u! m& y3 Jwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'); G% X, R- Q8 v
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
: L7 P8 O& c5 V, U3 X& Iwrite('</ilayer>')
5 Q+ `- z' N& v" r1 u- i}0 N0 q# y" z( K- Z7 {5 _
document.write('</td></table>')
! C/ e4 S0 x% h. [# B}& C0 A, e' e1 \4 n
}
8 O. Z- h: {* e; O</script> |
|