获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度6 }3 f. ~# ?4 G6 |6 Y" i
var marqueewidth=300
6 F" N6 Y3 k! _//高度8 K8 h! e9 |3 k# d& K
var marqueeheight=25
1 \! c" l' r5 P7 k9 s# C, E! q0 [5 w//速度(1-10)
3 t1 E  \! z, c2 cvar marqueespeed=3
) Z5 I, p' b) j0 n//背景颜色! z2 L! x! r, \! ?8 g. M0 b1 L$ k7 Y) ]
var marqueebgcolor="#FFFFFF"3 p  s* w3 Y% j  \4 A6 n
//是否能暂停 (0=no. 1=yes)?4 E1 i4 `- `& M! F" Z1 n6 e
var pauseit=1
4 J2 J8 z; t8 V4 g1 L6 v- s, D. D# C7 c5 X* K6 \% h" ~
//修改显示内容7 Y9 V* W: z* T  `1 C+ d. K; v4 }
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
, g( X) b5 B! E7 Y+ @
$ J  u5 g0 t5 T6 L. T' T9 f) f8 x& i9 d7 @4 v# \
////下面不需改变////////////4 I1 o0 ^2 V! _- _' ?2 Q7 v
" z- S" X0 w1 s6 x7 L( W
var copyspeed=marqueespeed
  _3 Z+ G8 }( o" Y, L$ e# Dvar pausespeed=(pauseit==0)? copyspeed: 0
5 }: P) X6 \# j0 b% Ovar iedom=document.all||document.getElementById! T! d0 k+ G1 w* n
if (iedom)& s" U. e/ @6 s( V$ D0 j! N8 u! M
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')! U' p6 M5 S; Y3 l7 U3 ~; o
var actualwidth=''0 b7 a: |- {8 @' I/ \! z
var cross_marquee, ns_marquee
: a, i6 O! e7 I& P7 V5 D: p
# e7 A7 A7 h5 Kfunction populate(){$ T3 Y' e! {& Z0 ^$ ]
if (iedom){
+ K- q; x0 ]; `0 a3 v; p* ?cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee2 ]7 t' q/ d. ?. K4 y
cross_marquee.style.left=marqueewidth+8
% p% A9 f/ c$ [* M# K7 scross_marquee.innerHTML=marqueecontent3 ^# r& Q6 G6 k( z7 c  w# t
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
2 B8 j' u$ Q  s}
9 `: z6 @0 h( Telse if (document.layers){3 K& O  q$ _( g3 }( O
ns_marquee=document.ns_marquee.document.ns_marquee2
6 y* H5 [+ A2 ?2 j2 z& \6 U$ zns_marquee.left=marqueewidth+8; Z" t3 b5 ?( h/ u
ns_marquee.document.write(marqueecontent)+ n# }2 K0 ^  t) h; c
ns_marquee.document.close()" f* I( j# m% Q
actualwidth=ns_marquee.document.width! _3 z( P$ h! {' }1 A/ q
}
1 v, U0 N$ @+ A8 ~7 D5 qlefttime=setInterval("scrollmarquee()",20)" J. a: w1 L: i
}3 ]: _! j( {; U( z* M
window.onload=populate, n2 m2 y* j: ?- s% m

& j3 d8 N8 O8 g( pfunction scrollmarquee(){
! Z/ T# J8 u+ ~  Aif (iedom){) i% b7 y. m$ T4 o+ h
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 h1 I& \! i5 _' \6 Y
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
& q" o5 O; D3 P  R" {% ?# |else) r, D2 A. g( T4 y1 P
cross_marquee.style.left=marqueewidth+8
  N0 s9 G4 O) E! N
; F- o. h; k& t- U( ]- @+ B* c}
9 v5 |6 M# Z) A2 e) {8 M$ Melse if (document.layers){
& {8 B. q  B- j( R, c% {; jif (ns_marquee.left>(actualwidth*(-1)+8))
# L9 Z1 e! d- o% r0 \+ Bns_marquee.left-=copyspeed
( X5 v5 m& r" D  n0 Zelse$ r# {9 a  m5 B) Q3 O# A
ns_marquee.left=marqueewidth+88 u; o" L# l4 E- }2 W
}4 B7 P5 Q! o' P% p% ~
}
: X) ^6 x! h7 h* Z) w( E6 {  m  q8 P& {& I! g3 |: y8 ^2 M4 S
if (iedom||document.layers){
/ }6 I$ }8 s6 g! lwith (document){! S9 d; [1 D! x
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
, Z5 M( [- H  ^. ], a7 N5 n( vif (iedom){1 X$ M' c  E  c" `* X" {
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
6 q2 Z; n; b% `+ E) D/ d$ t2 ?# R2 @write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
, U% W8 U- d9 k2 L+ B; [2 Y# X+ xwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')1 ~. X( t0 _4 D- e
write('</div>')/ a# L# r( c  N8 Z
}
# p0 K$ B- n* g1 [% Qelse if (document.layers){! k+ A+ d/ Q# q, j- m- E7 i: N
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')( I5 u" f: ~% v( g9 q+ h
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')# g0 D+ N: W+ z$ f6 @& a6 B+ c2 e
write('</ilayer>')# u0 |3 A$ n; u1 n9 w5 }
}
3 U* G" Q- M% o# Adocument.write('</td></table>')
  \' s( z  g- ?9 D7 p/ ]}% I7 c; l( t6 C, C! ^% W5 O2 A% c  ]
}" D6 \: T. A8 ~' C: H, T  ^4 j& D
</script>

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