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

|
网页之跑马灯文字特效
//修改宽度% _' o; H1 h* C7 T' X# A t! k
var marqueewidth=300
$ }. D# }! ?$ W" j//高度
8 ?* F- R# }% w4 b" c! i; tvar marqueeheight=25
( g* j7 t4 A4 x$ {% h7 K1 d% J//速度(1-10)
% b4 n( J1 j% ]! Z' Fvar marqueespeed=3
1 h! G) P' \! Y//背景颜色
0 m; V1 X5 T# ~* m4 ]8 s* y. Rvar marqueebgcolor="#FFFFFF"
* ]2 p# K( T6 O- f+ ~//是否能暂停 (0=no. 1=yes)?9 L3 Y+ \9 J6 [- n
var pauseit=1
. D! U+ e0 M7 ], l7 ^& u. J" ]' T/ s; M& b
//修改显示内容. l, f b; M1 k+ t$ ?' X& I
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3 C& z2 E$ U E' ^4 z& G0 Q
+ v0 I# Z% M# e9 T: s! M, g
6 ^" }+ n0 }* L" |
////下面不需改变////////////
, L5 M: L- I; W( _& e, ~- f# x6 {& H$ H( L) R
var copyspeed=marqueespeed1 I9 c' p3 t ]" k/ H$ _8 y
var pausespeed=(pauseit==0)? copyspeed: 0
D( d+ ?& V5 N' n) p7 Uvar iedom=document.all||document.getElementById. A3 I0 u4 e! t! C* |; o$ _
if (iedom)- |# B6 q: N Y) o1 m- r( H1 q& H
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')$ H1 }* z: X% x _+ h/ J" _( c5 `
var actualwidth=''
1 ~7 C# g- d7 r+ ^- I3 s/ s# Gvar cross_marquee, ns_marquee5 A2 P- q$ F4 F, Z/ R
5 T7 b: V4 W2 U( S! d2 ?function populate(){
' x; w) c4 ?+ W) I" g9 \+ \if (iedom){# }6 i/ K I- m" K
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
, {0 H0 o& q2 C8 b# J1 `cross_marquee.style.left=marqueewidth+8
/ f7 \: M, a. `cross_marquee.innerHTML=marqueecontent
u U; \- W/ M8 }actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth+ Q" l* j% O& L2 S, G
}
: X3 j! H) L3 ?1 delse if (document.layers){
- Q% g% `; ~$ y! [5 C' Ons_marquee=document.ns_marquee.document.ns_marquee2
6 l! W* K5 o) j8 b- e* ~# y, o0 n: d. `ns_marquee.left=marqueewidth+83 P( W) V- ~/ m1 M6 ~, f5 Q
ns_marquee.document.write(marqueecontent); I# G$ `1 `4 E" R
ns_marquee.document.close(): g) T9 w M" l6 f2 [. X
actualwidth=ns_marquee.document.width
4 m7 `/ M. g7 p6 }% K1 q- d}+ \+ x9 v) |, q+ f2 `1 F
lefttime=setInterval("scrollmarquee()",20)
( h( J+ O% Y8 E% [$ F}% G. Y5 F4 ^3 H
window.onload=populate
1 D2 N% m9 @3 z! I5 o1 [
* Q% w7 d3 X$ R6 V5 efunction scrollmarquee(){7 d6 i b" [% ]2 V! X; q
if (iedom){0 {) C: v7 {' n
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)); l" Z& U. u4 r; [. E+ V
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
* s+ b+ ]5 [/ k1 C8 Helse
+ s% g; B: f0 m r. z4 icross_marquee.style.left=marqueewidth+8+ R7 Y; v! u$ }3 B) \
# s2 I/ W" [* O}
# a0 i. R. o3 `2 F9 x1 v5 _else if (document.layers){1 E4 D6 e: Y( ]( ~( S ^8 g0 J
if (ns_marquee.left>(actualwidth*(-1)+8))3 t! f, @2 H% e I" a3 u
ns_marquee.left-=copyspeed; P5 ?" G2 y) P9 i8 }/ b4 }
else/ x3 ]; r3 E- n+ m7 s1 Y# A. M- i
ns_marquee.left=marqueewidth+8! S9 M! M2 n( P) ~8 n, E. r3 `* I
}
! r, B5 p! K& G O}1 k0 c5 t. o7 K" h% i5 V' x
$ I2 |- T. E; x$ C4 ]if (iedom||document.layers){
+ u2 A* h3 }% Z+ U% x6 _with (document){
$ X8 K2 K8 e& {document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
/ v. Z4 s0 B- H' h3 J. r% }if (iedom){% a& {8 X& u( D5 x; c
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')9 Z; f" v! k" u% {. f- n5 v; f
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'). W5 U4 x0 \4 ~) @; l
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+ \: g) |- K# ?0 X4 | ^- M* ^1 uwrite('</div>')
) D. n( N4 B* D. Y- n3 F}3 u7 l# l C8 y! J' x% ~6 b8 [
else if (document.layers){7 g% T! H% M# V4 ?* ?3 _
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')4 K& q) o( w( N) Z5 A/ a4 J: J
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
1 l+ L! {6 t) c( y& K. hwrite('</ilayer>')
/ ]7 o. b# F& m6 v& X7 V. m}
# v) n* s0 A" r/ O- ddocument.write('</td></table>')
; g% `6 _* S- v; U& x6 h5 j- B}
- g/ ^, ~8 d9 ]3 M- G}
0 o2 ^. Q- f$ L' y, @5 W$ C) k</script> |
|