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

|
网页之跑马灯文字特效
//修改宽度. w1 _# ]; A" C
var marqueewidth=300: B( C2 M# [) Z' J* Y: l
//高度) S+ X' W& l7 S# [0 P' F
var marqueeheight=25
; R C& @3 t: P//速度(1-10)" R! m+ [5 b: z5 N) N1 Q
var marqueespeed=3
$ R4 H! T8 z# C% [//背景颜色: g8 W# Z0 V+ y0 b9 g
var marqueebgcolor="#FFFFFF"
# ]- P" V* ^' b* c//是否能暂停 (0=no. 1=yes)?6 ~+ r; ?: b X" M3 Q
var pauseit=1
) ~- K( ~3 v7 `$ y* X! M" q: q- `" j
//修改显示内容5 E( J) k) F1 g" z2 x
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
* c$ d- L8 ^- D3 }1 ~0 I4 D, o
# R! r6 \ j6 V7 [
3 ~6 O5 l6 s# K/ f2 j////下面不需改变////////////
, T% M& k5 n2 p# H
' B: ~& [* D K: E1 e& ^var copyspeed=marqueespeed6 M; n3 d B* N/ E( ]/ L6 \% q
var pausespeed=(pauseit==0)? copyspeed: 0/ j/ E; `% v5 Z! C) W, }3 D
var iedom=document.all||document.getElementById
% S/ b5 y5 H1 U6 fif (iedom)5 e m4 p0 }% d
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
7 b" P! N' J) s) C4 I& `var actualwidth=''
I) r# a$ A- [# ovar cross_marquee, ns_marquee4 K9 L! V+ y% r( y
- V4 d/ z% B s% A+ r
function populate(){
# j3 o- ~( M0 ?& Y! p2 F7 ^6 Mif (iedom){
4 U. v; i. r( x: Icross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee: K7 P4 {! T! Y- F" p
cross_marquee.style.left=marqueewidth+8
# l: g8 k/ N, @2 Scross_marquee.innerHTML=marqueecontent
! P) m3 V8 o7 \( S: mactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
7 W/ ^$ @* t0 L+ N3 Q% m; z}
& P( ^3 ~0 i, ~& w% pelse if (document.layers){% c& O7 \# r9 e8 F* a: u
ns_marquee=document.ns_marquee.document.ns_marquee2
+ b4 V2 y# e2 t3 `6 Qns_marquee.left=marqueewidth+8
- v M0 B) a* Z/ s# G, p% [ns_marquee.document.write(marqueecontent)5 N |! A1 m. |( U) Z+ a1 f% a
ns_marquee.document.close()
( A, ]4 _0 {/ c9 W: ?; Yactualwidth=ns_marquee.document.width7 [; F% s( H7 V, o( C
}
& D& f- b2 U6 jlefttime=setInterval("scrollmarquee()",20)
8 x, x! `; J4 D( }3 t. U}7 }, v7 a c( ?" I ]
window.onload=populate" _! v% Y! s8 \6 S# o2 L
" s/ {. R( X8 f, K$ v! V
function scrollmarquee(){
8 k- C7 y/ } z: c- `$ D5 N. T ~% z4 zif (iedom){3 W. v3 Q, U: ?7 Q. S, b6 \
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
. B' F/ }% m1 `" H6 u7 {! n# `cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed9 V% _+ W" T$ ^" j3 }
else
' _3 t$ b! s& q7 B2 ?& Gcross_marquee.style.left=marqueewidth+8, S6 K6 f. ?& q: A$ B l+ n# A
( }; R4 C3 g ?& ^
}. X% C; u; @: e, y5 a3 H# ]5 g: V
else if (document.layers){9 P0 U* L5 T8 \ P% l2 ^
if (ns_marquee.left>(actualwidth*(-1)+8)) v D, h1 l' ]* O
ns_marquee.left-=copyspeed; o& l/ j1 u. c! j* p1 y
else
" ` m8 X2 y% B' r/ f/ h0 n: Ans_marquee.left=marqueewidth+86 t* G% Y, e$ R# o& p9 Q+ a# r
}
. Y$ {; R% G- A! `) s9 t& `9 O! k}6 S' ~ W/ @/ B
7 u. P2 C5 `/ z! w
if (iedom||document.layers){' Z$ N n. m4 e0 h7 z
with (document){
' R, ~2 F9 o! O; D' zdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')" }% C4 a6 p* M1 x) \! l
if (iedom){, t) S5 q; u/ i1 \
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 M/ I7 O9 j, O/ h1 o0 Xwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')0 \) R- }+ t+ l
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
8 E2 |/ C% P# Fwrite('</div>')% A1 }7 B7 M- p: |
}
- r+ j# O: g E4 u# \else if (document.layers){
; ?3 u3 {* a! }; }+ |0 }4 i* p- k3 Bwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'): M; u+ e% E3 o" e+ I4 v
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')" x+ W- Y) `. I. n
write('</ilayer>')
2 t$ O! i; Z7 o8 r}
# m1 a9 R: x1 Mdocument.write('</td></table>')0 }0 R% n# c% g% [( P, R* d
}
) j+ E. r' e: ~: x! s0 m}0 E7 u7 Q5 F- `- `) x1 k
</script> |
|