返回列表 发帖

网页之跑马灯文字特效

//修改宽度
' ~" E4 E  p3 V, F  P7 gvar marqueewidth=300
# R9 C" e  B' e, E//高度. T6 K6 D& e5 s; l4 w
var marqueeheight=251 Y$ k, p( I1 L4 f* C
//速度(1-10)
' n1 C9 M3 }3 a2 dvar marqueespeed=3
% r2 h8 P& h9 e# @6 \1 P//背景颜色: ], c; ^% M( @! j+ ]% h3 n
var marqueebgcolor="#FFFFFF"
/ I5 M8 G! b6 C/ ^* s- W4 \+ T//是否能暂停 (0=no. 1=yes)?4 O8 \8 \, c. I: i2 I
var pauseit=18 E7 r! |! O0 `& L
2 L% u8 f/ l% d* x- v
//修改显示内容
* V+ g6 l2 r3 [4 _' o# ^# U8 H3 E- y3 evar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
# F) z& z8 C4 W% r3 g9 x" t$ x* h( Q
) U5 _) C# W! Y) \: l
+ M$ J7 k7 j2 U$ j1 c# B+ B////下面不需改变////////////
, l  b" L$ F4 I" g+ @) `1 ~( s* O" A1 I7 p; o
var copyspeed=marqueespeed
, V) m8 L  ?: c8 Xvar pausespeed=(pauseit==0)? copyspeed: 0# [2 w( ]# ]( \5 p. s; `
var iedom=document.all||document.getElementById6 f' t& B8 G$ b" N6 h* q: v% v
if (iedom)0 [0 l' Z" T& w8 K+ r- }  ~
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
/ M; K6 ~2 C% Q9 m# G* l6 wvar actualwidth=''- I& x8 d7 U4 S. M! H
var cross_marquee, ns_marquee
+ A: Z1 D, g, r2 l9 d7 u3 I5 V+ R& Q5 y
function populate(){+ h: V6 L  h' P. z+ S" e
if (iedom){
9 c5 I* C! E3 ~* @8 ucross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee- t4 B* U/ b# U( L' P& s# M& E
cross_marquee.style.left=marqueewidth+8
1 I' {" F" \# w! Y0 D- W, Q9 L2 ~) Gcross_marquee.innerHTML=marqueecontent  U, W% K& Y( ]
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
2 P8 x/ A1 [6 }& q0 x( T}
2 d- b( [4 t7 Z3 c+ l4 n+ b9 velse if (document.layers){( E* K7 w$ I5 p8 n
ns_marquee=document.ns_marquee.document.ns_marquee2: V! K& `4 z' e3 b/ ]
ns_marquee.left=marqueewidth+8
( b& \, V1 I4 V( S$ |, ons_marquee.document.write(marqueecontent)
" z  W" n) Y7 ^$ K3 k% G8 fns_marquee.document.close()4 A9 x- }$ l$ [5 m+ G
actualwidth=ns_marquee.document.width
. S) c! h( j- O9 g0 V}8 i% c- L+ l4 Q) s+ D) |
lefttime=setInterval("scrollmarquee()",20)+ Z+ _6 |1 V9 r
}* y2 `) r0 s; K
window.onload=populate
. z! N) j& n  k8 t6 ?. W/ G6 K" I8 l4 M
function scrollmarquee(){' Y. a, D% ^4 S' l; X
if (iedom){6 V3 Q+ `3 i( h: B
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 z, m( y* Z9 m3 G! z
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
% m/ G' J4 y& T3 `else
  [1 c7 N* U  Y$ O0 zcross_marquee.style.left=marqueewidth+8
3 m5 `( z$ F# T0 _
1 x& g+ y) p% x" _4 w+ H0 G}. V' T- w! H1 F& f6 }# v. S7 c
else if (document.layers){& N2 b% u: ^7 E( h
if (ns_marquee.left>(actualwidth*(-1)+8))
0 W0 @) o. L+ k9 L6 x3 Ons_marquee.left-=copyspeed
7 I# n% a' A  {% Helse! {7 d0 v# p; y% B* t& q0 L4 o
ns_marquee.left=marqueewidth+8
. {+ [* T% J, T$ T9 w}
( [7 F3 \: M, d: g. J8 W8 Z}% n/ P; i  x+ P! S
( A) t8 _& w2 `. j/ @4 N2 C
if (iedom||document.layers){
0 Q- X$ u5 k9 o% V) }6 Iwith (document){
. Z3 L3 d& G" F# u2 z8 e8 I2 a4 udocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
1 r6 R9 N/ J( X3 G8 Pif (iedom){
7 C/ U! e3 F9 n. |write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')% X! E4 |/ @$ }& }% {1 O1 Z3 I# V
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')  J  g- b  B8 j9 S) F
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')" u) C' M+ P" @! Y
write('</div>'); i1 J3 m% ]' X2 M) K! s% Q" _: g
}2 x  W) Q4 s* k3 q0 ^6 r  `) W, f; l
else if (document.layers){
- e' {( [( p8 l7 ]9 B0 H! s5 ~write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
5 }# k9 W0 y0 y& O7 T* ?write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
+ k( X% I$ l5 J5 F) Twrite('</ilayer>')# S8 |# R  x0 a2 t9 F
}4 v- \" u9 @# @' y9 }6 Q
document.write('</td></table>')& k$ ?6 p1 K  |- J
}" q; Z2 K7 f# y  E& r$ j
}7 p. W. B* q% B
</script>

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