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

网页之跑马灯文字特效

//修改宽度
/ U. Z$ M# Z5 t4 Evar marqueewidth=300
% Y( d- V( B  P( T//高度
$ u1 O3 t; S" `. Q+ Q, L  C3 C. L4 ^var marqueeheight=25
$ V  R) `( |# D  b/ k$ X//速度(1-10)
6 o' G% A% e5 w. V5 uvar marqueespeed=39 h0 S1 ^3 U$ q; A
//背景颜色$ X- D0 W" o3 O5 b; H( f6 s
var marqueebgcolor="#FFFFFF"7 o: w; T/ k( B& f
//是否能暂停 (0=no. 1=yes)?
% f5 Z2 N# _8 N7 q1 W, Ovar pauseit=1
/ n7 D* F6 m4 g) m
# C+ S1 V' G! k4 J3 {; N//修改显示内容1 r1 @1 a4 K7 E3 l3 d$ D
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'6 h$ H0 ]- R; `! F( S: h- S
9 z0 C% m1 ?5 [, n4 V' e6 r6 r

1 T7 W' {8 k* M9 l  O. v////下面不需改变////////////
0 J. b% E* v, ~( {% l; B: `3 S# @6 X
var copyspeed=marqueespeed3 _! V8 L& p# B( Q+ K( S* @1 @( n
var pausespeed=(pauseit==0)? copyspeed: 02 m  F" J3 @  ]# {9 y8 l
var iedom=document.all||document.getElementById) f4 K* [3 N5 ^6 E  R: `" [
if (iedom)
- a" ^. Y! X$ H# k- g: r* Rdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
. C( R1 [( k- N! @/ c2 c( Evar actualwidth=''
' S( @% }: G3 G) L9 y8 Zvar cross_marquee, ns_marquee4 h, f9 q5 @2 m8 v4 e

& n& B' k9 \9 S3 }function populate(){' X" J$ b: g# W/ ]) l6 T7 B
if (iedom){
9 O/ m% m; R. Z- e1 o1 Z5 M; |cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
% L" m  w1 j( A7 M/ }" b6 tcross_marquee.style.left=marqueewidth+8/ }7 A  S  @" Z/ O
cross_marquee.innerHTML=marqueecontent
7 [* Y8 C. ?8 \' D+ Qactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth. e- V& Z8 q& B. X6 i
}
2 L& N5 }9 [7 U1 T/ x4 Jelse if (document.layers){
$ ^; s2 G* ^7 M2 j, r8 D% Yns_marquee=document.ns_marquee.document.ns_marquee2
. E: Y& l# W9 ?5 t& z- R/ gns_marquee.left=marqueewidth+81 i/ `1 v1 |: U6 I
ns_marquee.document.write(marqueecontent)$ u% ]8 y1 E9 T* W! w
ns_marquee.document.close(): Z6 S7 ^  D8 g/ y. l
actualwidth=ns_marquee.document.width
# [( b2 `; T% c: w}
& H% F, d0 L! J  l3 @; Z7 i; glefttime=setInterval("scrollmarquee()",20)( o( a$ m+ W0 Y. ]+ l: `
}, I5 F9 T3 c, E3 o/ K  Z8 s
window.onload=populate* v# c! \# A, V; v, ~
: ]/ \: M% \( Q  L+ F# F; e0 c
function scrollmarquee(){
  c# O3 c% i. c/ N/ a) \if (iedom){  G$ E( Z. p* M$ R
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
/ i9 {- z! e* F1 R- |5 }cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
: f% K% C. b3 g" [! O2 P, melse: j" G5 a: h" u  i7 T: t
cross_marquee.style.left=marqueewidth+8* F1 F2 Z" v8 a

1 Q0 {, x: {$ O4 x}. W. H. t$ h7 t7 ?
else if (document.layers){# o3 Y0 x4 a* V4 u2 R
if (ns_marquee.left>(actualwidth*(-1)+8))
  ^9 Y& w" Q7 x; ^8 U6 x) Uns_marquee.left-=copyspeed8 F& J, c; S& `
else: Z2 |" K% }& f/ {; M. \
ns_marquee.left=marqueewidth+8
4 @5 V6 I0 @* b1 k$ }}
8 F1 O# Y$ q4 h, d; Y}  m4 p7 u% ]8 O( ?9 M

  f6 ]$ L* P. O1 W' oif (iedom||document.layers){9 W  ?$ M* D% Z% [& q
with (document){
2 n4 `; T" a# n9 o+ edocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
7 i" K7 I+ e. s  z, c% }if (iedom){
/ I8 v6 p" }$ n- Dwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
' B/ ~  s! ~+ Fwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
" `; p' X/ K5 L' Swrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')/ b% W/ ~9 e$ s6 U) V% R. D2 N' g* h
write('</div>')/ \( ^& }& A0 `
}
: I+ d& r8 [( P0 _! y. m9 V: r9 I  X) k4 Qelse if (document.layers){$ }/ g( w  _: f8 F
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
) n  c1 }  K, ~0 d6 kwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'): t' j+ O/ a  s$ m6 C7 p- s' M
write('</ilayer>')
9 R1 s/ q- m" z! U6 h* n. m}
5 X' U& E/ G. g# odocument.write('</td></table>')- R  n1 w! x$ D" R
}6 o3 B8 S) _, T- t6 q
}# b/ {, T/ Q$ D: l% W/ {% L  V' U
</script>

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