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

|
网页之跑马灯文字特效
//修改宽度: {# S7 g/ v) K3 `/ k5 |7 L( B& t
var marqueewidth=300
7 ~9 @, }- N- g. u//高度
6 _ M/ G4 c/ Cvar marqueeheight=25: o$ R& D% K, l" g! F
//速度(1-10)% O( O/ h( [, J+ F9 [
var marqueespeed=3+ M" N4 y; d2 d0 ~% G
//背景颜色
' E* t+ `+ k9 Ivar marqueebgcolor="#FFFFFF"& _; l; _8 y; Y% a: \* t" U
//是否能暂停 (0=no. 1=yes)?1 G; L% h. ]0 x/ ], @
var pauseit=16 [- x5 U6 e+ {) m& c6 ]
4 \+ B/ w# `% ~" B; u( j//修改显示内容
& q( [) |: f$ F$ rvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3 Y% q1 n# V+ M- `# Y+ n5 [
; ^9 C& i. A4 d- X$ z, N1 e7 w" d
. ^5 u, a; D4 P& L' y2 [
////下面不需改变////////////
" M% w7 I- n- l! z( P" e
/ G2 Y3 c: X/ dvar copyspeed=marqueespeed
. _) r! G9 v8 A. |8 i! Xvar pausespeed=(pauseit==0)? copyspeed: 0
I" I8 K4 S3 Ovar iedom=document.all||document.getElementById( g2 F$ [- W2 P3 M0 n, s, Z5 z0 s. Z! G
if (iedom)
! c7 \" K R# U& F3 D% Sdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
0 g% O' u3 v( n3 Y6 yvar actualwidth=''6 I3 E; m# c* H) |& F
var cross_marquee, ns_marquee
& x$ E! g$ c1 |4 c( }. f6 U, b6 i
: g& x) z- I) `; |4 C, y/ hfunction populate(){
! [! g2 i" n$ I. [" eif (iedom){6 q6 }$ v/ B8 f
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
, q$ I4 N5 u' ?! W3 D* o1 Dcross_marquee.style.left=marqueewidth+8
. {5 V) w p' _1 Ecross_marquee.innerHTML=marqueecontent
$ o6 i: m- f4 Q5 I9 S4 {actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
$ Z) E6 Y( W2 G _' B}
4 `2 S9 l9 G' t) Lelse if (document.layers){+ z8 S+ I0 m2 L2 V8 X
ns_marquee=document.ns_marquee.document.ns_marquee2# d! ?, \* {+ L1 z/ s- b1 l
ns_marquee.left=marqueewidth+83 I, @2 y9 H7 v5 D
ns_marquee.document.write(marqueecontent)
9 W& _1 A* F8 q% Y8 Bns_marquee.document.close()
1 I+ I8 W i/ k9 x: [* Pactualwidth=ns_marquee.document.width
: s7 f n! A1 q3 k}
; b$ `) H2 H" ulefttime=setInterval("scrollmarquee()",20)& b- m) h. {3 Z% B4 ?$ F
}
: D- ^0 i% l' J( C. D7 Y: ~8 Zwindow.onload=populate4 L+ D" T4 Y; N/ U- P
; M; G. s8 P7 H# R
function scrollmarquee(){# \, I' h, m- E8 L& m: ?2 D, i2 _% `( r
if (iedom){
: F% g. Y# o- f) ^if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)); i5 t$ e' o0 G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
L1 }. M0 p+ }1 {else- }) a5 V$ s/ E; D
cross_marquee.style.left=marqueewidth+8 Z+ ^- l% B: f2 B# R5 U
: y( l. }* Q6 ^. \' |}" w& r' `/ H1 ]' |/ h
else if (document.layers){/ I+ t; }! f0 L% {/ t( [" z* _$ l- g
if (ns_marquee.left>(actualwidth*(-1)+8))3 e5 t. g, i! ?
ns_marquee.left-=copyspeed. A$ P" @& Y. Y( g3 \8 v
else
: u9 S' x& C$ Y0 N4 `4 f. u3 nns_marquee.left=marqueewidth+8+ ~, {+ Y, |: ^; G5 d( y
}
|3 o, a x# p' e}
5 D3 y3 a8 f9 J" k
. m2 `2 Y7 d% v- I1 C# aif (iedom||document.layers){2 D* O0 |4 Y9 U$ d: d* k; ?; u
with (document){
1 A; _9 W2 F v- ]document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')3 A, P: g) r$ Z: ?# q4 V0 y
if (iedom){
& C6 M# J2 F! swrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
8 N/ X8 `9 V" A' a# Y) d9 z# [4 [write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
- G& F; }2 [% l+ Uwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
* C+ m0 |" a! M0 [, u wwrite('</div>')
4 O3 n- T' Y0 X# g! L}* N. `! D& ]! K8 I! w# w
else if (document.layers){/ v1 x7 j( x+ a1 O9 N6 u; R0 y }
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')# ~6 L9 `' ~1 O; c$ P4 g
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')- q: [* j Y% i% e B
write('</ilayer>')
4 u9 e/ l/ e) d; k# q3 l}
3 U! e u9 [' Kdocument.write('</td></table>')
! j* U& z' D' W6 Z# v}
. J! R- w* q* P0 r! F" q}: X4 o) T& Z9 f' q$ U) c
</script> |
|