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

|
网页之跑马灯文字特效
//修改宽度/ z3 l/ _3 @: b6 ?! e
var marqueewidth=300
8 ?( C$ K- k$ |7 H' P1 N+ |/ W//高度
& R# T9 ^( \! e; k4 O, z" jvar marqueeheight=25) G8 s6 j% b; Y) c7 H3 D0 S
//速度(1-10)
" j' T/ q7 i$ G# f" E1 f4 `var marqueespeed=3
$ E7 i1 H" D* h# z//背景颜色
; H. Y/ p. p# _0 y" Mvar marqueebgcolor="#FFFFFF"6 n" e' e+ I, G h
//是否能暂停 (0=no. 1=yes)?
! e9 V j" N# B) lvar pauseit=19 O" e% G0 x0 c9 }- y
" S* Z1 t' j/ Q+ h" h
//修改显示内容
3 m, W" _/ U! {* A2 Yvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>': A2 O4 `5 O P* g6 b
+ Z$ B9 W* S6 b3 ^6 L
! z; p& ^7 n7 I4 L* e4 W3 x; l////下面不需改变////////////# O3 j0 e6 Z2 h$ j
7 P) m+ ^; r/ O+ L- @/ i5 Y
var copyspeed=marqueespeed) o2 O3 Y0 n! K0 }
var pausespeed=(pauseit==0)? copyspeed: 0! U, n5 `. }: \; t
var iedom=document.all||document.getElementById
' z& N9 @2 J+ y: B3 L8 f$ J* Hif (iedom)( h1 y# m; w6 S* p2 v- R% V& [
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
0 K* P6 l, e& j$ _8 svar actualwidth=''# y5 o5 j" l* [2 a
var cross_marquee, ns_marquee+ z# }, k8 K4 p: V* z% f3 B* L
- @) W9 {! O/ [! p5 I6 z6 |function populate(){
& F6 q( K9 b8 Uif (iedom){
9 G$ ]9 o0 e7 {9 |0 across_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee. O4 Z/ C+ N/ x' w, T
cross_marquee.style.left=marqueewidth+8
4 J- ~9 R) }: M. @/ E+ @cross_marquee.innerHTML=marqueecontent2 w, @4 F m& K
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
, d4 p) \/ {4 ^& E- }}+ _* k; Z3 S& F8 O4 m: l
else if (document.layers){
0 a! T. D9 Y+ S$ E8 ?ns_marquee=document.ns_marquee.document.ns_marquee2
1 K3 X x, }8 b" Uns_marquee.left=marqueewidth+8
$ N2 x) n7 z+ e7 }/ rns_marquee.document.write(marqueecontent)
7 X6 g& F/ K7 H; c7 k3 u) J- fns_marquee.document.close()9 v2 k# X5 S& Q8 D/ `
actualwidth=ns_marquee.document.width9 M+ j A$ p6 B
}4 [+ q) |! J" v) I0 J
lefttime=setInterval("scrollmarquee()",20)' D) k: p- v$ C1 x
}; W! E/ N( F7 h/ n9 n* b
window.onload=populate( b- \, l0 g8 I( y, m" O
3 q9 V A' S i& Dfunction scrollmarquee(){+ ~% G6 m7 k: f5 k; O9 T
if (iedom){
8 B6 E% x: O% V) A1 z6 qif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
7 O3 D9 [. s3 U5 }- K/ qcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed8 i4 v7 \& ^% k5 B
else
+ t: u3 }7 B- z9 F* V* Scross_marquee.style.left=marqueewidth+8
* I8 M& k5 |; t. \2 \4 b
- H3 W' [0 V8 [% r}
7 Q' |1 y+ F+ U% A4 [2 welse if (document.layers){
+ N1 K. c- _: S+ ^, g o# p% s5 Mif (ns_marquee.left>(actualwidth*(-1)+8))
5 [" W! T& x* j' U5 m- X, `ns_marquee.left-=copyspeed7 _ n$ u/ Y `: ~" E
else
" m( C: F# l7 d( p4 `0 `4 zns_marquee.left=marqueewidth+89 r! W5 t: a1 Y; `9 Y, X0 H
}" Z' z6 n. P$ p/ T/ ?: `
}
; M# I1 ?9 Y1 `8 B5 i' n/ a& L3 S4 N6 v1 b1 ~
if (iedom||document.layers){
2 y0 s0 j. ?* O V! G$ Lwith (document){
' O9 s* ^$ D& g" Mdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
l: V2 h" |8 [2 \if (iedom){
$ w( ?; Y' u% t awrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
# v$ c0 Y9 n0 A% [/ v) Awrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')/ C0 c5 i2 m+ P) B
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
1 [9 U* J g. _' v2 ?write('</div>')
2 G+ F7 J6 M+ Q4 k}
* h/ A, H. l. Y2 H" P0 helse if (document.layers){
* {( P) Z5 r: Nwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 T; z. H: ]6 O9 A
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
7 F( a" Y A- ]7 ?9 x9 kwrite('</ilayer>')
) }% H. V9 n8 P0 s* B0 D" o% \}
" s9 ]( V3 j5 T3 ]1 R+ H& B; o8 S- vdocument.write('</td></table>')1 N1 q, D; e' y1 a5 Q6 d
}
a- `6 ~; D( y: N( z/ e}
' ^% c& m; M/ p8 G</script> |
|