返回列表 发帖

网页之跑马灯文字特效

//修改宽度8 o& y  O; U1 I5 g
var marqueewidth=3006 d& P5 W$ e; D. L, T! x
//高度
; ]0 D  D, y9 m, G. }var marqueeheight=25; H- h% J( y1 T1 ]( }- Q
//速度(1-10)
/ `) u: R, Z/ v( Uvar marqueespeed=39 s! x' c! `  K! X0 Q) f% Z
//背景颜色
* H8 t# t, f9 [2 n' K7 D% o% Uvar marqueebgcolor="#FFFFFF"3 b2 I3 B) l+ H9 t9 H2 f& i1 L
//是否能暂停 (0=no. 1=yes)?
/ }. e/ J" d; S8 Kvar pauseit=1
8 _0 `" Q2 X. f2 P" V7 N) o" {' Z: j" G
//修改显示内容  g, ]5 b& y( m& Q* |2 M8 d/ _
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
$ g: U& C4 A  d; B' M
4 {+ [/ i! ~6 j2 V1 W" p/ {
9 e+ f1 O) D' ^, [; t* P////下面不需改变////////////
: g. a* A- {3 \, l. U3 H3 \4 D& L2 T& \5 i6 j" n) i
var copyspeed=marqueespeed
) m* z- L7 o% o4 r* K, y1 k& Rvar pausespeed=(pauseit==0)? copyspeed: 0' c8 o/ O. g9 Y4 R; Y
var iedom=document.all||document.getElementById+ K& u* g. T2 Q; ?
if (iedom)
* c2 w1 l7 d/ g3 r7 l& Zdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')- D$ |# T& B: d9 n4 X
var actualwidth=''7 I5 U2 ^0 }! r: i, Y
var cross_marquee, ns_marquee
+ y9 \2 D7 r2 F3 L0 U* L' p0 T8 [) g( U; ~: X  i# `; t
function populate(){) C" z7 C! J! g6 V
if (iedom){
, t- R+ G7 z5 @# kcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee3 G, v% r5 h/ Z  p* b' j  M
cross_marquee.style.left=marqueewidth+8% ~6 i7 L" B) h' h
cross_marquee.innerHTML=marqueecontent
( J# {6 ~) R, G* Gactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth. h+ P, f) o2 g) R0 e$ B
}
8 l& E! Q4 \  v$ M% I! C. E: F: aelse if (document.layers){
, U" x9 D1 z7 Lns_marquee=document.ns_marquee.document.ns_marquee2
% C. Z- R( h8 r; Q5 i3 F  u5 @3 j% vns_marquee.left=marqueewidth+8
! w# z! D7 M9 c7 Lns_marquee.document.write(marqueecontent)* a% d( r8 c: c0 A6 _2 o
ns_marquee.document.close()
1 `8 W* d7 \: ]actualwidth=ns_marquee.document.width
; U, _: S2 s1 m: @' [}# Z5 R# D7 t/ f) E0 s
lefttime=setInterval("scrollmarquee()",20)$ v  O5 K- X- b: J4 @% A5 v
}3 v- D- F5 g4 G! P( A
window.onload=populate9 |6 l* d" ?1 c+ ^. m

( u7 x! F) K; e* Q* x( v" }! Jfunction scrollmarquee(){. h+ M# y6 j$ K
if (iedom){  D9 h8 m+ p9 H6 `# K% d; n
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)). F. Z9 ~: A& N6 u% n
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ j) _3 M! k3 s6 N
else
+ v6 I( c( U( [3 x0 L% ^cross_marquee.style.left=marqueewidth+8
* t2 n1 l0 }+ X3 _0 m# Y' t* ]! V+ J- M1 J. v3 ~# N
}8 h( Z( @8 @3 R/ n! c: Y) `
else if (document.layers){
8 a. ]5 l, F( x; Dif (ns_marquee.left>(actualwidth*(-1)+8))* M- q) ]* O7 b( h* X
ns_marquee.left-=copyspeed) m5 u7 ~/ g/ ~2 B( n! j3 q0 x8 [
else9 W  {1 W8 M, J* h; |
ns_marquee.left=marqueewidth+88 f# z! B1 E. W! l
}
/ E% U9 \1 a1 f8 H8 [}) N# H: f9 @; r8 w$ Q
! z  ?2 T3 J. M" O
if (iedom||document.layers){
$ m2 L" Z4 h# d  i# Hwith (document){
2 Z. e. c7 E& D1 S, I9 H  Q: x5 Jdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
3 `' U& H9 x& aif (iedom){
0 M" s9 ~7 X9 m2 i& Jwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')/ P# F1 K0 k; Z
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
' g$ J  n, e% Y8 Gwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')8 T! o3 K. J. g" N! J4 k7 d
write('</div>')
4 }7 D/ T% R1 S& |}! }, U7 D5 F. z* @1 v1 z
else if (document.layers){" `  P/ k" O+ r3 U! C: d
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
# z# H$ F% t/ H6 v& M8 Y5 cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')% u7 N5 {6 B  F  P" [2 q
write('</ilayer>')+ G4 K+ g# o0 b: ^  ~
}
) G  u. v* C. q! f% _( rdocument.write('</td></table>')
, g$ ?+ I+ @# E5 x) Q8 R& X}
: k* b. r7 r, z9 V$ ?3 y}
+ H; O2 W. Q/ @" |! \</script>

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