返回列表 发帖

网页之跑马灯文字特效

//修改宽度3 ?1 k( |+ ~7 ^3 |  k
var marqueewidth=300- X$ L1 n, d5 M" `7 C
//高度
; s5 e: F- g- n5 Gvar marqueeheight=25
3 Z2 U, X5 _* r  G" I//速度(1-10)
6 B$ _5 f. R: i+ n! G/ a- t+ gvar marqueespeed=3
: Z$ X: ]$ G/ ^//背景颜色
2 V& l0 u# e: w1 ~var marqueebgcolor="#FFFFFF"! {& l4 p, L5 _9 N5 i
//是否能暂停 (0=no. 1=yes)?0 P! p5 }$ u; y" X9 N: ]3 p0 X2 j
var pauseit=1$ R# u# M$ o- A. L5 o& ^
% f2 I1 p* J4 @  B8 ]1 _( e
//修改显示内容0 D+ {( {! M: U& [0 L7 G
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
# A/ K: c7 ]3 B
: s4 W% k2 d2 h% L+ D% P; u, b0 R  t( H3 g) G6 R0 u4 [% F1 a
////下面不需改变////////////
( ~) `7 x7 V4 @4 ^# v. e  [3 S$ l1 e5 ~6 l: F' J8 X% W
var copyspeed=marqueespeed
9 ]1 c  C- Q' \var pausespeed=(pauseit==0)? copyspeed: 04 v, a% G8 Y9 g5 k/ J
var iedom=document.all||document.getElementById. e4 J( y6 [, z3 q
if (iedom)" U$ G) H/ f  q! Z9 t
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')0 V6 D% G& ^6 P$ k+ `) r
var actualwidth=''
, @7 I, O7 @3 o  Z- a/ Fvar cross_marquee, ns_marquee9 K9 Z5 \( \* W) F8 B+ H5 I- c; v
* u/ T; b0 k- |1 W% m
function populate(){
  n! x3 l; Q; Wif (iedom){' }! l( P3 @8 T" O% l, P
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee' V, A& O% N6 B0 A1 K
cross_marquee.style.left=marqueewidth+89 B0 o8 {* Z( O8 Z. E. Q
cross_marquee.innerHTML=marqueecontent
1 t: O/ Y8 S5 u% C& y& Dactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
! `$ u7 Y* w1 h}1 e- Q( {1 C; c1 c
else if (document.layers){/ ]; ~2 A* g3 R( Q
ns_marquee=document.ns_marquee.document.ns_marquee2' ^) H$ Z7 Z' _' Z5 n! Q' x
ns_marquee.left=marqueewidth+82 H" Y( w4 D( T. Z* d0 E; ^8 G
ns_marquee.document.write(marqueecontent)
1 _% H5 k/ g7 Sns_marquee.document.close()+ x1 M1 p) g! V+ p
actualwidth=ns_marquee.document.width
+ f8 R4 H% R2 E$ w( L, n' r}
* }+ M( K( ?$ F' I) xlefttime=setInterval("scrollmarquee()",20)' N( ?( W( H3 }$ {1 Z
}
' j2 ]( K/ a3 R' Xwindow.onload=populate; U& P! Z& W9 e- S- ^& ?' |1 F& W  n
9 I' [/ i& d. G) z
function scrollmarquee(){
$ R* \/ b/ T4 R. r# y2 tif (iedom){# l+ q& W" c5 F0 W; {; T
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))$ a9 O! A! i; _' [. L
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
( J) q# D2 B4 Y% {% R; w# ielse
$ M+ B2 m4 e+ O; @# H6 pcross_marquee.style.left=marqueewidth+8
- H5 E) X0 o$ Q1 e6 V. u  @0 l. Q$ o
}
: N- e8 J$ L. p# Z9 P6 jelse if (document.layers){: D* y8 t- O3 [. g* _
if (ns_marquee.left>(actualwidth*(-1)+8))
: ^. ~* }# y1 c' L' nns_marquee.left-=copyspeed4 O4 X! G0 j1 A! J! O
else
9 Q1 v9 I7 e$ D. p$ Ins_marquee.left=marqueewidth+8
$ {0 \# h( y  l: S" N}2 `* Y2 S( r( I, \+ r3 n
}6 Z) P  u+ }- g4 S

$ u* D# b- {# P( Mif (iedom||document.layers){6 \- C  h# Z8 p3 j
with (document){+ U3 h7 E1 ~/ [( |' w2 {4 g  q  e; p
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
# ~- o7 w0 L8 g% ?if (iedom){* j( y$ G" @3 j4 K4 T
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')" G1 G, W: B+ b( {6 f
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 @1 u/ x/ t1 l1 r0 bwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
( u3 `. Q. ?1 [: W8 y# I; nwrite('</div>')' Y5 m$ y9 Q* v3 {! t- y. l8 @* i
}
; n2 v: Y0 y  T; velse if (document.layers){7 M7 ~8 [7 X6 q8 Y3 {  w( Y
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')% ~2 r' B$ b: h$ d! {- `
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( E& J  J3 Y( n- T$ T& A. `
write('</ilayer>')- N3 {7 Q/ m( o( D7 s3 n3 K
}
* _- A' e, F7 K% ~! J& gdocument.write('</td></table>')
% G" S, E" G& J2 M$ h, w5 Y}& K0 E4 E+ X4 F3 ~. w4 [5 X! Q
}: M# f9 ]+ N+ `7 S9 p/ `+ H
</script>

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