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

|
网页之跑马灯文字特效
//修改宽度+ ^0 l5 l' I. p. M' H, A. p
var marqueewidth=3005 K& p7 H( }( I& i$ d; I4 g* u) D1 H
//高度 U N, _. x; V7 v. I! X% Q/ i
var marqueeheight=25% k6 U( U* L3 D1 S
//速度(1-10)' M n) }( }+ z5 z
var marqueespeed=3% _0 ~( E8 s( T6 f* l8 H
//背景颜色
* ^0 \. [/ d6 A+ f( N6 d+ b' |- wvar marqueebgcolor="#FFFFFF"
$ j1 S4 R0 V) t4 t4 U/ o//是否能暂停 (0=no. 1=yes)?( V6 N" c4 F+ o: l6 O* H
var pauseit=11 s% ^8 C L9 M
7 l9 E! X# Z7 @# Q j5 [//修改显示内容2 P7 z. \" p# |
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
' y) C& ~* \1 O& f& ^/ g/ v- o2 c4 j# S1 z( G
7 M, n" q; R2 G( V8 ^1 A3 Y, ]( Q9 b
////下面不需改变////////////2 n$ y& [* T1 @, _: O
% Y; X# f% K( ?% K" M
var copyspeed=marqueespeed p2 g5 K4 v3 _! c0 P+ u
var pausespeed=(pauseit==0)? copyspeed: 0
1 d! ?" I# `* l* Ovar iedom=document.all||document.getElementById1 }9 D5 Y( T' @" [# S
if (iedom)2 C- J3 B% d. P5 y9 j% I% ^& D k8 }
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')- k* y F t% F
var actualwidth=''+ y4 U: x4 X) w" ~$ K0 z
var cross_marquee, ns_marquee. |' u f8 D8 G @# _( O
& _! Y: J5 o' U9 d5 P. [+ \function populate(){! z: {1 ^9 c+ N g: ? S
if (iedom){$ w6 Y7 L/ S& `" |
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee& r3 s |1 P/ `- v8 G" u
cross_marquee.style.left=marqueewidth+8
# c' O" o6 F' R2 t# Dcross_marquee.innerHTML=marqueecontent
' H3 |2 W1 w0 M3 h* H/ l2 ?0 Gactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth, ?( X: `# i9 ~" M- a
}
- K# w8 m! }$ { R- e+ K" Nelse if (document.layers){
4 i! O6 F+ @, Dns_marquee=document.ns_marquee.document.ns_marquee2
5 S( H6 P$ v, H ~: ]7 nns_marquee.left=marqueewidth+8
! I1 L7 _( \$ s) H6 Y2 Wns_marquee.document.write(marqueecontent)
5 f; {# E; X3 jns_marquee.document.close()8 g+ e9 h+ ~7 Q) J/ q. |
actualwidth=ns_marquee.document.width* c/ e! _" \1 e+ d4 Z$ h- ]
}$ L" r0 f; w- S2 G) c* A% G( {; j
lefttime=setInterval("scrollmarquee()",20)- _, ^( P) f2 z" @5 y
}& O8 P3 N0 t% Q
window.onload=populate8 s4 @" Q/ G+ M5 ^7 ]( m
1 G( D" C5 [4 B8 I. ]
function scrollmarquee(){1 x8 K1 f/ P$ y3 L1 g$ I) P7 I
if (iedom){
, d( Y- _( T, l5 B- m" }" aif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
$ |/ F0 z$ @% P) W# ~" W6 Lcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
. i, e( B4 K3 e, O$ V& d# ?: l, j5 l& Pelse
& U O& \8 \( i/ Mcross_marquee.style.left=marqueewidth+8 R; p# |. ^: s
2 ?# y$ A5 C" a4 p* _& Y6 j# K
}7 x5 ]$ Y% e/ n5 l7 O
else if (document.layers){
. t5 Z6 y" {3 x7 d6 oif (ns_marquee.left>(actualwidth*(-1)+8))7 q" B6 T: U# ~
ns_marquee.left-=copyspeed }: [6 O8 ~# S% W3 J+ S& {: q
else
! c3 m9 R7 e0 R7 r# X/ ?ns_marquee.left=marqueewidth+80 s+ Q6 P9 t9 a$ C
}
& H6 H" f3 |% E5 O}
$ P/ x1 y3 ` D( o) {
. C( y2 I4 d# [# u, ~if (iedom||document.layers){
* ~2 H7 P* A- Ywith (document){5 B5 M$ }$ W. T, O' c
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')! j8 v: ]9 M' O- U `( o
if (iedom){
" l e. z& M: e) cwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')% ?8 G2 P6 ~" }; _, H
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')9 `1 [* N6 W, H7 S2 p+ b. |/ H
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')# H" N0 Y* I; c. Q/ h! w
write('</div>')6 \: Y! o" z" K" ]8 k8 R) h% B
}& y% I- @& V2 K$ G% m8 `1 h! t
else if (document.layers){* E7 m% a- [6 r5 t2 u6 \$ c+ h. ?
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')& k9 b" Z$ }8 S' F0 R/ X
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
5 I! ~) z% Z4 F( [1 L3 e4 A) gwrite('</ilayer>')
* x6 B# k g& S- A7 V}/ }2 t0 N% B, E& Y2 D2 j
document.write('</td></table>')
: l: @" O/ X2 ~& x0 m/ Z% }6 ]- k3 f}4 q; ]# V' v" j
}
. K% s% _8 p) K4 @) z2 P0 E! Z3 t! x</script> |
|