返回列表 发帖

网页之跑马灯文字特效

//修改宽度
4 v5 x1 P2 l9 c' T& Fvar marqueewidth=3007 Z/ ?) z4 c' B( n
//高度# N% N$ B5 |, f3 q
var marqueeheight=259 s+ E7 L4 _: |# d
//速度(1-10)
" D8 a" `$ a3 P: A( ?var marqueespeed=3
" B& x% x/ o! K& j/ Q, A//背景颜色
. T; c9 [- x6 W/ I; }var marqueebgcolor="#FFFFFF"
& l/ L' Y  T8 `//是否能暂停 (0=no. 1=yes)?
4 h4 g$ Q" `$ ]0 Zvar pauseit=1
6 S6 M" ^) h# S+ {6 K) {3 ^6 k+ J' V5 k; q4 x
//修改显示内容, y* k% ~9 o, X4 M/ y
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3 R1 ~  j1 V/ E/ }0 m8 Z, Y
+ w- J" j1 H; \5 c

, {  N7 k7 {% Z9 g& R' G% P0 K////下面不需改变///////////// i/ a, n6 @$ T& B  x
7 O( O0 ~( w( Q
var copyspeed=marqueespeed
+ C/ j9 h: `' B# g$ Evar pausespeed=(pauseit==0)? copyspeed: 0$ g- ]$ x! c' \9 x3 c( p2 o
var iedom=document.all||document.getElementById
5 Y+ S* y: f. k, N2 h3 a- kif (iedom)
7 n% ?! \8 `0 h1 |8 Ddocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
* r/ Z1 \! U9 @% V0 B+ S1 Q" D6 ^var actualwidth=''% W: C6 G! g% S) [6 W
var cross_marquee, ns_marquee
! H! R# j2 E5 d2 v( X
% E: ~, }$ M9 K: N/ w3 Pfunction populate(){6 W% H& B: Z3 L/ a
if (iedom){
4 b0 ^# b( ~3 k% @! zcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee" B0 S. T# ?  W
cross_marquee.style.left=marqueewidth+8
' o# `) J2 G2 d( Tcross_marquee.innerHTML=marqueecontent7 q  U3 e: O5 P  p9 y4 t5 b
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth/ ^3 ^# ^4 P8 [
}1 \8 ~" M' z& P6 d' I
else if (document.layers){2 P8 H/ Y( V( {' D
ns_marquee=document.ns_marquee.document.ns_marquee2
+ ]& t: G1 v/ A  u* t+ N' sns_marquee.left=marqueewidth+8. a4 W3 }$ R. D6 d
ns_marquee.document.write(marqueecontent)! A- T% F2 ~; M& |; p
ns_marquee.document.close(): s) t  ^/ o! H9 a' O; @4 `
actualwidth=ns_marquee.document.width, }6 m% k; x- H/ P" B
}% W7 T2 `! A0 S2 k7 T1 {# g
lefttime=setInterval("scrollmarquee()",20)
, P6 v! I. ^5 u* r8 V: v1 f% i}
  p; C( c. X9 W* v3 L7 W: J5 Hwindow.onload=populate  q3 _: S) `  r8 z8 ^$ z6 j, H
/ O" u1 A1 D8 ^3 e
function scrollmarquee(){
! O% b# c( N4 Fif (iedom){9 z$ u* D* w( g: C$ }
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))! [+ l. A1 ?5 P5 ~! b
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed) Q& M! U) N+ z' z5 E6 V
else
# S! I- O- N& ^1 J7 _: J6 }cross_marquee.style.left=marqueewidth+81 ^# p, u: N. o' C  v3 ?7 M' v

  \7 W9 [. H1 F5 ~7 ^) ]}
4 M4 T1 m  ^4 l, L2 v1 Felse if (document.layers){
, r0 K0 ^5 y# D6 s7 Vif (ns_marquee.left>(actualwidth*(-1)+8))+ v& G- j' c6 A" z; i. b
ns_marquee.left-=copyspeed3 F/ r  [, u( k3 B
else# L3 ~1 c4 U; d. _, k
ns_marquee.left=marqueewidth+8. x6 ^# j, t( T2 ]
}. m+ C( w/ H) r* n" F. ^, ?# ]
}% I5 E: S1 S- h0 R

! G' K* f" E; I" ?! @0 v+ i" H' K) iif (iedom||document.layers){( X1 T- l5 W* Q6 N7 g
with (document){5 T- a/ Z, M  ^( [: X
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ L0 I& |* Z" X0 J. `( n6 L% Zif (iedom){
* j  Z, s7 P. [; A) O+ D5 [write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
, @8 g4 i. Y6 bwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')! q4 p1 n$ p' ^' C3 @( b5 `% s% J4 @
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')+ F) h0 |5 g* B0 P$ ^' \
write('</div>')
, T5 `" D2 z0 p' k+ X0 \+ L}0 I' G. w3 o, m
else if (document.layers){
) v2 j0 b% I1 w$ q/ ]/ qwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')9 h6 j' f5 @7 ]( f, d
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')" d! W! H. C/ r' s9 ~
write('</ilayer>')& @4 l7 V- \$ M
}
% o* l2 C8 v7 a5 e# edocument.write('</td></table>')
$ a8 r/ \, U% m2 p}
6 \8 W" e  V; t- a6 W( A: r$ f& I}
! Q% |9 w5 A9 @) U( h</script>

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