返回列表 发帖

网页之跑马灯文字特效

//修改宽度: R- ~: Z4 ^+ [$ B7 t
var marqueewidth=300
" m, n2 g% e; i0 k//高度# S* Z" x6 a8 O2 T' ^# I% j$ ~; o
var marqueeheight=25
- m  f$ `8 G. I6 G//速度(1-10)8 V2 L2 L/ B) N" I$ F4 g6 W6 a
var marqueespeed=3) c" W8 m3 F" F+ M9 \$ p
//背景颜色
& a0 e$ ~9 Y2 ^# k6 O! T  }var marqueebgcolor="#FFFFFF"
) L' g- _' r# ~  y' N, P8 A* `//是否能暂停 (0=no. 1=yes)?
  O7 W) w3 A; |0 Dvar pauseit=1; N4 a% J5 j/ O- L  ^3 K6 V; u

5 q% {, l1 S/ A$ H//修改显示内容0 ^1 @1 l9 }# h* Z4 D7 _# }4 ^7 M5 R
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>': o  V4 E- O: M3 r7 Q. k

9 D; k& W" D: {. I0 _% a/ ]. J* R) c* f3 o
////下面不需改变////////////
5 Y! M' ~5 p9 P+ J- J  m* x$ L! C+ u# p* |5 e
var copyspeed=marqueespeed
% K7 M+ ?$ A( n7 Y' ?* F- fvar pausespeed=(pauseit==0)? copyspeed: 0
. G# t  x& X$ D% j* B0 lvar iedom=document.all||document.getElementById  ^3 a! H! j' q, J5 ?
if (iedom)) f! ?! U- ^6 \* a$ P
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
0 p: I) F" r/ \( S, |var actualwidth=''8 L' L, U# h9 H5 k  v  c. S
var cross_marquee, ns_marquee! A8 d, F" I/ l7 m9 N" a3 X+ U
5 y* x3 k4 |% ^! i; s7 z
function populate(){
* w0 G- u4 u" D6 A1 J8 k" ^; oif (iedom){# w. e/ v. Q# u3 ~% @& e# M: ?; {
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee  E+ h* c0 @. G& M
cross_marquee.style.left=marqueewidth+84 n2 i; k- O) w# ]  f
cross_marquee.innerHTML=marqueecontent
; A6 \/ Q) \% @& yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
6 L& C9 s* w% G! b) ]4 A}
% H3 A4 x! [- ~& G& B2 v; U3 H0 Uelse if (document.layers){
! L  J1 k# G% z4 J! dns_marquee=document.ns_marquee.document.ns_marquee2
2 b) Z2 h  j" ^2 h' q% c, pns_marquee.left=marqueewidth+8/ W$ D) h5 B, l3 \# B
ns_marquee.document.write(marqueecontent)
( j' K9 j: {6 t4 e( C2 ?0 |ns_marquee.document.close()
  r' `  R: I7 [+ p; mactualwidth=ns_marquee.document.width5 a/ A" z* i' L& n: Z9 ]
}
/ a7 t# T( p5 V, J  ^& b* }0 o% A2 klefttime=setInterval("scrollmarquee()",20)
% V( _& Z' }4 P/ R+ m  D}
. I; d/ `- q# f& Owindow.onload=populate7 _$ f! G) I5 Z, n7 G1 W

- {8 Z) N, t% c: p5 ^7 A( ~function scrollmarquee(){
& @8 P4 K( c9 m. u4 ^if (iedom){1 J; r3 S; b9 m" I8 p8 B5 n+ v
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
7 e: h; e( G7 S: E" Dcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
( v+ D' ]) s- y, `! {& @6 Lelse
' a7 N, V/ t1 Jcross_marquee.style.left=marqueewidth+8
3 Q  C! G. q6 P2 ?" W# H* W. \7 \, g7 J! Q6 v9 Y
}
& _  r2 w& a, G) Helse if (document.layers){
( Y" Q9 r' ]+ E; D/ p# r0 [4 Zif (ns_marquee.left>(actualwidth*(-1)+8))
2 ^% I) D/ i3 L, b! ?! Ons_marquee.left-=copyspeed8 F0 C$ l. y$ N* e' f5 M, R
else, e: h/ p4 \. R1 d- m
ns_marquee.left=marqueewidth+8# [& o$ F% `8 v6 j" \1 y
}
1 D# ]: L2 x8 i* c- T}
  o& `5 c; q# K. P2 N4 n# `8 k# G9 m4 k0 p5 e: q3 J, [9 s' u/ r
if (iedom||document.layers){
+ a% [* {9 n- `) Z2 Cwith (document){
, [( o. Q/ S4 E0 bdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
" {, R8 D2 ~# T7 H2 \% u8 `1 o2 hif (iedom){
/ _( ]" g8 |3 E8 b; zwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
2 ^8 f  v, K  H, gwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')9 m- m" a9 A9 |& d
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
/ u; X) d, A( n6 S1 iwrite('</div>'): O+ R2 u$ R6 Q4 R
}4 x7 E; m' t7 G
else if (document.layers){
: m3 V3 Y/ f" _. G8 W% C5 k: kwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')3 \" H. z6 x1 W+ G7 i7 L
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
0 W; h( Y4 a# I! s$ lwrite('</ilayer>')
" \/ T% M1 T% ~2 ?: J}3 `5 h# e" K6 R5 j& }
document.write('</td></table>')
0 g/ j+ N9 G# e; @# ^9 r}
# K% p, x  ?9 O5 l* M# z) h}
. f1 [& z! A! q( N</script>

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