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

|
网页之跑马灯文字特效
//修改宽度) t. h" F/ k1 L; Y5 a: x0 Q6 s
var marqueewidth=3009 Z3 z% R/ q* G# w
//高度- m% P9 E* H! U* n6 t7 \+ T! i
var marqueeheight=25
6 B9 @+ O: e3 C' p+ g7 N//速度(1-10)
8 `; l4 p' q7 \) r1 Qvar marqueespeed=32 E3 t9 j+ i. C8 [# E+ L
//背景颜色
+ v, z; ]6 C( _$ o7 g/ {1 pvar marqueebgcolor="#FFFFFF"
8 [# ?8 t2 X, w' h% r a//是否能暂停 (0=no. 1=yes)?
+ m. Z8 O5 f9 l8 R. x! ]var pauseit=1
! o3 e7 ?# r9 b, K: P$ R9 m( i
//修改显示内容/ D L$ E: O' Z. b! n
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
$ Z( _ V$ S, M0 z9 ?2 o. r% N! a. B* i. A; U
0 B$ C# X- P8 g/ T1 _4 R5 X/ d////下面不需改变////////////' h& M4 C/ T; a1 c- r$ ^# P: q
- a$ ?- J1 f6 v/ _% Z- X
var copyspeed=marqueespeed
, B4 B& \: }, R% ]var pausespeed=(pauseit==0)? copyspeed: 04 h2 h O( Z) C, P* V
var iedom=document.all||document.getElementById( g) Q+ c& N# k% C) I; b+ b3 c) e, X& ?
if (iedom)
@$ B8 y D& rdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')% V2 o/ B4 s, r3 g' K
var actualwidth=''
* T6 d5 x9 G! L8 [8 Rvar cross_marquee, ns_marquee8 W# r* S0 |+ ]. a
/ w. [! n, S6 m9 q' l+ h% E N6 R& w
function populate(){( _. K, k" i" G0 K- w
if (iedom){
! J5 A6 U9 k9 w9 g3 T4 Bcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee4 N. w2 k- t: ~& Y8 }& S
cross_marquee.style.left=marqueewidth+82 ^" f# @1 O) \! Z; w3 S
cross_marquee.innerHTML=marqueecontent# S2 }6 u) ?. L: u# ^, U! V8 {
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth: @4 z8 [7 h( x" L) n+ k
}
" a, O: o( ?' r6 ?: p# Xelse if (document.layers){
t3 p2 |/ H/ D; \. @2 jns_marquee=document.ns_marquee.document.ns_marquee2
- }7 \, g0 R$ g6 Nns_marquee.left=marqueewidth+8; z+ Y5 p) g0 Z: M
ns_marquee.document.write(marqueecontent)
, v& y9 M6 T5 R( G9 c P( dns_marquee.document.close()
' W. R! n8 c$ O, ^5 F+ j( ~3 r8 vactualwidth=ns_marquee.document.width. y' |8 [9 W5 l
}
$ n& K0 d! ^: q; Y9 J4 flefttime=setInterval("scrollmarquee()",20)
6 T o" b4 s; a8 e. L& u; ^1 q}
Z+ ]# F% |- u0 p9 p; cwindow.onload=populate
( j% F' N7 l( ~) w. ^% n; {" h/ K$ }. U+ [
function scrollmarquee(){
9 f4 a/ a: D2 d4 n/ I) Gif (iedom){0 n4 y9 R) j+ t. C F. t
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
! @6 E4 M$ i2 B8 w% f/ h6 B# _cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
7 K t$ M* F8 K& L" E9 W eelse; J& [- R6 F0 M* t
cross_marquee.style.left=marqueewidth+8
* Y# ?! o! u6 e* W
2 p* X' F5 ~3 J' I' n}
n- x8 Y8 K* Q" ^$ lelse if (document.layers){
% J% Z x: h8 _& _+ f: _if (ns_marquee.left>(actualwidth*(-1)+8))
2 Z8 W% C' V% _( \) ], _6 Wns_marquee.left-=copyspeed
" [2 _5 t0 Y4 w( x- A3 D' Gelse1 @8 M7 Q# T8 J$ H& b& G
ns_marquee.left=marqueewidth+85 t0 S" \. c+ G/ S$ k5 b
}$ _# r. d+ h9 m0 _- Q3 \6 }
}
* x* e3 f" x( D% G: z# K1 x* N/ U+ O4 W+ o; d2 h6 m' _1 q1 ~5 m
if (iedom||document.layers){
* n" i F8 T7 g# Ewith (document){& L; n/ Y+ c: X1 R% T) y
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')% ]" [. w) O; ?. E! y
if (iedom){1 [0 t: }6 `6 M$ y3 @* G
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
) ]# B5 w3 q+ x# ]5 f& uwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 R# v4 ~9 R/ z9 G. \" o2 i2 S7 owrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 C; ~2 }! g4 g8 lwrite('</div>')
& P$ E5 C- x$ V' j- |}
" n8 }- y& _; n# Jelse if (document.layers){3 ^1 _4 t0 |6 |7 j3 P7 _4 a- G1 p2 v
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
- k' D5 i' r5 \7 u0 Qwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')2 d8 g! g8 a( s: a* Z* `4 ~4 q( G
write('</ilayer>')( B) f8 y4 A: k" j( t
}9 y% ~% b5 Z! j( l
document.write('</td></table>'); p3 P5 B" L# ~9 ?
}, |: H* H0 ~: V. s6 ~" R
}
8 p; j4 Q9 t9 P* L* y0 K</script> |
|