|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度0 R! H" k2 |6 t. ]7 z8 I
var marqueewidth=300' t- Q% Y, Y6 n2 i
//高度
; |* a5 ^6 ^2 t$ C( C# ^var marqueeheight=25; U$ x- {& R: b$ x4 U
//速度(1-10)9 j- f. _! A" @0 B0 S
var marqueespeed=3
+ I D; ?' k' u1 O# M2 A4 _//背景颜色
: Q- z% w9 l# z4 I5 Pvar marqueebgcolor="#FFFFFF"7 Q$ @* c9 X; \" M( f
//是否能暂停 (0=no. 1=yes)?5 [* [* D) {3 q( l2 H4 V0 u. s6 R
var pauseit=12 p" f3 F7 b) V4 j+ E
) `/ Z: l9 ~9 a. p( n; i- ^
//修改显示内容& o5 `3 X$ k- y2 _% h& O: R7 Z
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'- N1 J( ^9 D4 P# x4 G1 j3 P
- I1 x# e5 \: o
, R C! A; ]7 W# f////下面不需改变////////////
A4 f8 ^ [; O% G2 v4 f* F* h% Z
( ]% e( c5 y) T) F- m/ Uvar copyspeed=marqueespeed
, `1 G3 ^* D: c) ~- Wvar pausespeed=(pauseit==0)? copyspeed: 0
& @: ?* r% v6 }# a, ivar iedom=document.all||document.getElementById/ D; ?+ N% Z- j( ~7 i
if (iedom) w8 ` I% _7 H; ~4 Q3 G
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
6 `* P7 ^+ H9 R; z+ J3 h6 Q; m% Nvar actualwidth=''
) |! x- ]- B9 Z* [var cross_marquee, ns_marquee0 i# x2 W2 F$ G5 n: _# \
5 C M0 }! H) w0 wfunction populate(){: n$ M2 e6 U$ C
if (iedom){# Y5 \; I- }% P# v
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
7 ^6 A9 ]9 B2 M3 d9 ccross_marquee.style.left=marqueewidth+85 A. E, k' S2 P
cross_marquee.innerHTML=marqueecontent
$ V! U% D. i1 M3 a. D3 jactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth+ F( n1 } ^( G
}
( C6 J }! g7 M7 [3 q8 pelse if (document.layers){6 h" R4 h& u. F2 [+ p, f! G3 i
ns_marquee=document.ns_marquee.document.ns_marquee28 S Q3 W" r, r: b) m
ns_marquee.left=marqueewidth+8
0 O: m/ O; B8 o2 W6 z! |* H3 m8 E0 ons_marquee.document.write(marqueecontent)
6 N; Y1 a$ e) c6 o. Hns_marquee.document.close()
! T+ f! ?3 A U% e+ Y$ factualwidth=ns_marquee.document.width5 u% m% ?5 W& O& q$ w
}
! q, q/ l9 e8 _- z5 Clefttime=setInterval("scrollmarquee()",20)
1 h# l) s" G, _6 u: {3 ^6 V}5 s" R: d' {6 t
window.onload=populate1 T2 f/ O7 R4 ?& j* _7 ]- T0 C4 {
* d. @$ S& W4 G' Cfunction scrollmarquee(){
) W2 R: B, }! s4 r9 Oif (iedom){
4 Q+ A( B: Y! h- n* _2 v! gif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
4 h! s% f8 _- K0 V1 {$ V; o1 a0 ?cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+ |8 S5 P: C. ^: K m0 D9 M/ @
else8 s- q/ ~5 `3 D
cross_marquee.style.left=marqueewidth+82 }9 X% G% t: A, b0 C) T5 E6 Z/ K
" ?" a6 ?& S) q1 k0 y* v}8 w4 T `$ {& L; s
else if (document.layers){
# i1 `0 Q2 w) ]9 [/ d8 vif (ns_marquee.left>(actualwidth*(-1)+8))
& W3 R; P1 _( Fns_marquee.left-=copyspeed/ g; E5 a$ i3 Z/ M& E5 v. c; B
else
" q6 i S' y# p9 n8 `' o8 ]' kns_marquee.left=marqueewidth+8
% g# I8 \9 O% j0 ^0 J: I}! V- Q2 S1 ]* d$ m
}
: k5 {4 M e) F: m! S; [+ `# S, L8 d
if (iedom||document.layers){# V* b1 |4 k g+ ]# z" X1 |, U( H* Y
with (document){
. h7 V& w" q* y3 ]document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
2 z: N* z5 B0 M" p, jif (iedom){0 ^) G9 b* d1 D! Z; g, z
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')1 B6 U% {3 S5 w' U& Z t; _
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
" `! ^4 a8 N2 Swrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
. B( n' L M. I1 wwrite('</div>')
: C" I) P- a/ G. h}, _$ g9 B% C8 j0 | w) u
else if (document.layers){, R7 _0 ^* b8 P9 M y5 f' W
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
) f% W! E A) q5 V, M* X5 kwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
0 l. D6 H: R; i' U# E3 kwrite('</ilayer>')
& e. a) i0 i& W" S# N$ G0 `4 r}
9 S0 r+ {$ W0 T" [* Xdocument.write('</td></table>')
) ]7 h4 d k C' ~4 w9 Q} V z$ G1 V: A& t- G' `0 X/ j
}4 \/ a1 p0 }5 g9 b- _1 T
</script> |
|