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

|
网页之跑马灯文字特效
//修改宽度
; E. u' M- P4 ?3 f7 |( }5 j6 mvar marqueewidth=300
0 }( j1 D1 Y' J( e- K7 U( S//高度
- g& y( y# R: _var marqueeheight=25
& v8 p- g! n+ Y//速度(1-10)
/ u5 I' k% l9 M, X$ p) `. M9 ?var marqueespeed=3' l7 O0 q; W5 a, @/ o
//背景颜色
4 w5 L% I9 s( C+ e" H8 mvar marqueebgcolor="#FFFFFF"
+ u/ w' P, F% W! }//是否能暂停 (0=no. 1=yes)?
' `8 P+ q- e3 Z- E6 Y- Tvar pauseit=1& R' U3 D1 B4 ~
8 Y. N& T" I0 V. J- I5 s- X
//修改显示内容
+ c2 o7 E! p( Ivar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
; j$ v4 a0 X' z# p) x/ ^! ^6 b
. ^& |+ h+ X" K3 {( P# [- f
) g! z. I& x- ~: ~////下面不需改变////////////
6 I2 P- z3 [; x/ I4 \' P% k6 T# ~6 }8 L w
var copyspeed=marqueespeed
5 [! w1 ]" M8 N. ]; U+ Gvar pausespeed=(pauseit==0)? copyspeed: 0
2 B9 p+ U; T9 A( ]var iedom=document.all||document.getElementById
% L* M; N" a( D; Aif (iedom)6 l5 i$ _# U$ _9 W$ b
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')* V2 }* } f* v- G" M; @( z$ D- p
var actualwidth=''
! t1 Z5 |& S6 B& V& A9 N2 e2 X2 Dvar cross_marquee, ns_marquee u! ]1 i. `4 Z3 S$ d Z: C7 [
3 n6 A* B/ j$ e3 k
function populate(){, d# b9 [- r( O6 b. O
if (iedom){
. [# ~# K7 p2 ~- Gcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee$ D/ s9 q8 O" F8 z6 F: v, \* |- S
cross_marquee.style.left=marqueewidth+85 |2 z' v, F$ s
cross_marquee.innerHTML=marqueecontent
1 y7 D: t) k8 u$ p: x% i6 ]9 E' Y$ ]actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth( J% o0 t) x& s$ k) ^# J
}
+ m& J, T, O# I4 R$ B* k2 lelse if (document.layers){% V4 [, {8 z" e$ o7 b# p) W( L) j% V9 |
ns_marquee=document.ns_marquee.document.ns_marquee2
! F) X5 _8 J, n3 X+ f! x6 P( {2 c% qns_marquee.left=marqueewidth+8/ C3 U: I( _$ Y, m* j
ns_marquee.document.write(marqueecontent)
. _( [6 x6 r6 h+ G5 F( c* I4 V( Dns_marquee.document.close()/ n% u9 g; q4 d9 W4 g
actualwidth=ns_marquee.document.width
' n9 w! r2 H3 Q}0 G" u8 J3 i p3 ^
lefttime=setInterval("scrollmarquee()",20)
/ Y' F! b: m) M9 c}
+ M0 H* S8 [4 i" f8 T" hwindow.onload=populate
$ X' G1 S; @- C7 W; j2 v: a9 {
# j9 V. h8 B$ Z" Ffunction scrollmarquee(){
; h, h& @1 V' G: o- N+ Fif (iedom){
2 n+ `0 n: A) M# D4 [9 n& iif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))/ k# D8 y3 ~! v% |0 k1 k7 o
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
* _* e! `) S) T1 ielse5 J- @1 {, O5 m6 P4 y
cross_marquee.style.left=marqueewidth+8$ d' H; |) E: Q% }/ h
0 v( W( V! k. w; C- D
}
7 d6 x/ z7 l, i( W7 z* f' B0 uelse if (document.layers){0 ~1 g! a* h/ Z) u2 N" z+ \: ~( Z
if (ns_marquee.left>(actualwidth*(-1)+8))1 P1 }& e' K* ?: S
ns_marquee.left-=copyspeed
, [. B- G/ A' J+ h {- selse
; j/ E* r! J6 p# i1 `/ D3 Kns_marquee.left=marqueewidth+83 v' Q# P! n9 w6 T5 _
}
$ Q. u! ]% v1 `; m% d, Z}
1 C# S3 \ q. J& L; J& L% ]* m8 I, |" E% u E; C
if (iedom||document.layers){: n* F o. g- H2 T& y
with (document){
/ \0 y0 s3 ?# W2 ~) ~: a# [8 B. a! adocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')6 N8 T, _: e* `/ c3 c) g
if (iedom){2 d. ~8 T: V; m R( w
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
2 l" O' y1 X$ H; Lwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
, X& I! b. b5 C1 @, ?8 Q6 Wwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'): Y. V- y5 w5 _% l, v5 t
write('</div>')) B2 L3 F0 M7 U7 F1 O: z
}; h: h' W# |0 J4 X) V
else if (document.layers){
: S) p5 X( k$ l+ r- |1 Bwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
, w: J* k4 b1 M9 h! Cwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')* b e+ t+ S. b* e. n3 ^
write('</ilayer>'): Y# D4 q' S9 V$ f
}
& m6 m# m6 W- zdocument.write('</td></table>')" I: w: o3 { K/ A+ d0 a( A
}
# S: x3 K# t3 M, t}
2 K( \( |" L% D0 A; `1 V3 _, r</script> |
|