返回列表 发帖

网页之跑马灯文字特效

//修改宽度
3 B5 T. B; j- X5 h  b8 n/ L; Qvar marqueewidth=3006 g$ l! L2 r! n; A" {
//高度. L! H8 [: `& A7 T- V
var marqueeheight=25  b. p# S8 S: Y7 a; S! c. d7 ?* U
//速度(1-10)
4 @1 z2 c, S( T* `( \var marqueespeed=3& C( G% _" s% y) Y1 I2 ?! g
//背景颜色# Y% w% F( L% H8 q1 |% C
var marqueebgcolor="#FFFFFF"
- v% S" x6 o/ E" ~' F# g7 R//是否能暂停 (0=no. 1=yes)?
. V4 W  O2 i: b0 wvar pauseit=1+ ^/ ^0 R' W' c! B3 G
3 E0 f7 {. S; W0 [7 F6 l4 d
//修改显示内容
+ h2 q1 V/ ]0 c2 @9 _: ~$ evar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
" i) m8 V4 A. X7 T0 ~1 i( [) U( u  Y& N- J0 g2 L9 K3 y& P

" _, c& t" ], u$ s////下面不需改变////////////
! G  E/ Q8 ?- C* l, ^$ R
+ G1 \  j1 Z: Z) T, jvar copyspeed=marqueespeed* q& a6 `$ I5 Q& N# b. J4 u
var pausespeed=(pauseit==0)? copyspeed: 00 y8 v* s& P2 O7 m
var iedom=document.all||document.getElementById1 t( f8 X8 @! q+ A- I; n4 W& m
if (iedom)6 C$ i- n( m4 P) U3 F2 @
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 Q/ V! V6 Z' U0 n' y5 u7 T+ @
var actualwidth=''- F8 n2 U" v9 x: J$ ]
var cross_marquee, ns_marquee
6 F! M7 Y8 G% R. F0 `0 g# ?2 }3 `
function populate(){! A- c; h: [) o4 s
if (iedom){
. T( X8 b3 Z6 z$ e/ tcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee7 Y) v  o  a0 W2 U$ b' w
cross_marquee.style.left=marqueewidth+83 h  E0 k% p* ]% L
cross_marquee.innerHTML=marqueecontent
; U7 x' x; \* ~+ _actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth% H. F9 x# ]+ f+ t
}1 k  n- U% F9 l6 Q$ {* X/ Q% i
else if (document.layers){3 b' |, T- I' Q/ C
ns_marquee=document.ns_marquee.document.ns_marquee28 l* q: \5 S3 b9 n/ |
ns_marquee.left=marqueewidth+8
8 y" x/ I6 R& @! N/ R  wns_marquee.document.write(marqueecontent)+ L, D1 E) A' g. R, n+ A# F
ns_marquee.document.close()& G5 `4 g# n. \7 b% h5 I! j$ b" Q( s  u
actualwidth=ns_marquee.document.width6 H, i6 U: {( e/ r. K5 q
}$ N. `- k+ f8 W3 j
lefttime=setInterval("scrollmarquee()",20)0 a0 h, q( H) y* d/ h
}1 v, c7 D, g- D
window.onload=populate
6 Q' J6 \9 ^5 N; M4 i3 ~/ V1 X5 a: [* Y+ J( h
function scrollmarquee(){
. ^9 w( d: m4 t9 W/ c/ M! w% Nif (iedom){
6 o- Z& c: K9 H; }5 nif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 r, P4 A: V) N1 _( @* g4 ~
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed. V- a; |. ^6 e4 k
else
, x3 ]5 L; x# x- S: t4 Gcross_marquee.style.left=marqueewidth+8
" L( ]& {! H9 A1 P+ v# m# @
9 c/ o9 G& o7 n0 I0 ?) N5 _}& ~$ j9 u$ g0 h. P6 O' x; D$ `
else if (document.layers){9 ^. y  q. R0 }! Q" v6 t( R- D( d
if (ns_marquee.left>(actualwidth*(-1)+8))7 n- o% J( Z# g* ~' D
ns_marquee.left-=copyspeed8 `# x3 w6 G& j% F' j
else  t% |8 E6 a- e( C
ns_marquee.left=marqueewidth+8
( b' u; [6 o5 v6 G9 q; M4 K}# N- q/ _8 L0 h( M% g' K  ~
}
" ~- c9 o" x" z% ?; O( c/ |0 G0 }4 j# q! \  f  z
if (iedom||document.layers){
' P# p2 k, I$ Ewith (document){
+ t( R/ M0 i; Odocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')3 D+ i: R8 K7 ~4 t- g  H
if (iedom){
, W0 u- t" X* r- w4 dwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) o, d( g/ T8 k0 y& L8 V2 Iwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
' Q, }5 ]: M$ }  _2 {write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')# c: l1 n" h" I
write('</div>')
2 T* _4 H: |9 M, Z}
. I1 x5 M) R1 p& n. Qelse if (document.layers){
( t, d# r0 u2 ]  Lwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'). D% `0 a2 {* }8 J; @7 u
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
9 v- r( ]! \+ f9 u( vwrite('</ilayer>')
) a0 w9 o# V2 m' w0 S- C8 ?& a}
3 ^4 o& Y) S7 U3 j$ t# h2 udocument.write('</td></table>')
2 I6 \( p2 P2 O- i" N8 z}- P8 W) l; h/ S$ y# h
}
. i, n5 H$ f; e. d</script>

返回列表
【捌玖网络】已经运行: