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

|
网页之跑马灯文字特效
//修改宽度4 F5 E0 x& i( i! H
var marqueewidth=300
; Q( |1 x [2 L" \- M8 l6 d//高度( q4 ^7 C" Q' U# t; t
var marqueeheight=25
5 \* A3 [: ?0 L1 U: |, @# O//速度(1-10). r+ n; L) N/ p0 D
var marqueespeed=3( I6 ?: o, [) b5 @
//背景颜色9 f# H8 Q* b/ O6 [) d
var marqueebgcolor="#FFFFFF"
/ n' S- d' T! z7 a' w//是否能暂停 (0=no. 1=yes)?4 A [8 ~, r: W% r- W$ _/ E! \
var pauseit=15 O6 K. s+ Y: J! i- z7 i9 M8 S6 O
- D+ M* _" H. X! a" I! j2 C5 s//修改显示内容- o8 X# W: y2 I' a# O$ t" z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ d- Z/ E' l9 ^+ J) g" }5 `- \# ~0 V
8 `* A1 R9 O# S6 c, M* J3 U3 V# y3 v' e: }9 A6 {0 ], e) S
////下面不需改变////////////
3 m$ Z7 P0 f/ g2 O
+ A4 \ ?5 k& B; Kvar copyspeed=marqueespeed
; B, S7 g) Z: ?) Xvar pausespeed=(pauseit==0)? copyspeed: 0/ c' s$ h1 ^/ V$ m
var iedom=document.all||document.getElementById8 J; j- t* f0 y* @# _. v! F W! v
if (iedom). g9 K4 `; u! k8 w* e1 c
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')7 ]8 V0 Q2 b$ a* }8 S' f( H/ s
var actualwidth=''
+ p- @5 K I/ u5 j6 E/ j* g% Ovar cross_marquee, ns_marquee
) X3 m" \. C% p" T+ T' Z$ l' ]: [* P1 v p
function populate(){
* k9 x0 a$ x) _8 V, Q3 Q+ ^0 H* [if (iedom){
+ \2 m* W; I9 ~. \cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
- M& @9 {- T. T: dcross_marquee.style.left=marqueewidth+8: E1 y1 a+ e8 @- B. q H) ]: O, \
cross_marquee.innerHTML=marqueecontent) ?5 }3 v8 }! C0 ~
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
. F- p' a/ g8 G& `3 v: v}
1 ] P8 J% T; y/ N+ c7 `7 Y. ?else if (document.layers){) u% j C6 k ?+ v& C$ x; f$ V
ns_marquee=document.ns_marquee.document.ns_marquee2
6 I8 O& D l. Lns_marquee.left=marqueewidth+8
) ` F) ]5 h. J5 t7 Vns_marquee.document.write(marqueecontent)
7 e) @ L* b, W9 M* f" V0 V7 Ens_marquee.document.close()
8 s: t2 Z" l0 r6 g. {actualwidth=ns_marquee.document.width
* Y9 t; a' z) J1 e) D}, P3 `; P+ `7 H% f5 T+ A! ^
lefttime=setInterval("scrollmarquee()",20)
' ~0 F8 @* t0 R! u0 L}
8 l1 E. W+ I# ^0 dwindow.onload=populate4 P' I) i: l4 ?
# c9 ~, G- `7 lfunction scrollmarquee(){' ?+ b. O, J& ] L
if (iedom){
- W% n8 n2 h3 x; z5 Hif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
1 W6 h" R, w8 {7 fcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed m# X# t1 C* f4 S5 z1 U% O" M
else$ `( A- f( u8 }5 u: y* p1 x- y
cross_marquee.style.left=marqueewidth+87 }% S9 _5 N, S4 j
2 ?0 ]6 t2 } v! `, D8 G}" t1 S, X" U2 o, ?% _
else if (document.layers){
) _5 u7 I4 b9 t+ _4 H0 _if (ns_marquee.left>(actualwidth*(-1)+8))! M: l. e7 c& ~, C- F: k( q
ns_marquee.left-=copyspeed
* a+ [' `0 |; y V- `else+ n9 J- O0 f4 T9 d1 @
ns_marquee.left=marqueewidth+8
( O# C. w4 o1 P, S* \) S T+ k}# W( t' I' h7 K+ V& A& h
}. Y3 F; G0 o7 a
- B- c9 V- F4 g+ N
if (iedom||document.layers){' p3 X& l3 t5 h& T% G$ G: p
with (document){
# W- w( s8 l0 x6 V# \document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')( v* B. } d5 |: v6 b4 m
if (iedom){* ]' i; k2 c2 b) Z4 z G) B h
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
& A" s9 T0 K1 owrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')* J" o1 ^/ m4 w* x
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
T, o" Z( N3 ]! p1 rwrite('</div>')
! Z' k6 D* b1 z- G- M5 m4 i}
6 M5 r$ w5 v2 {! uelse if (document.layers){! ?# _* h7 ^6 T; x
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'); J3 b* T* ~0 H1 |7 l8 f
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')9 o9 n/ l0 X( h, m/ q) W
write('</ilayer>')
) R q4 M0 D) N" @}
, G M6 Q' o9 s3 y: Zdocument.write('</td></table>')! P: e7 i3 R9 P- z- ^ A
}6 c! t6 _ Y% N! Q; z
}
6 Z( c& c( |7 u& w6 I0 V8 V. r</script> |
|