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

|
网页之跑马灯文字特效
//修改宽度- w/ F. v' w% r& u1 V* o1 o
var marqueewidth=3009 @% @3 \% t( x% ~8 b: \- m* Y
//高度8 L7 t. W) ?2 |8 }- [/ V4 H
var marqueeheight=258 I/ ]3 X# y% C; B, T2 `& z
//速度(1-10)
- r1 X4 t& n/ O/ T7 _. Vvar marqueespeed=3% v- V" F. J# _7 I) Y6 F
//背景颜色
- Z* i2 r4 m0 B! \% ?7 [1 S1 Tvar marqueebgcolor="#FFFFFF"
4 T1 f0 B `6 s( V8 G//是否能暂停 (0=no. 1=yes)?
$ M, d+ e: {8 V0 a% g. s: Jvar pauseit=1/ i7 ?9 T: e, S7 }* A' `
7 ^ I, h; _7 F& `' X S1 r//修改显示内容+ Q' ^( d, s( b7 i* T
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'7 m- a' Y, J8 e3 y
+ c8 A8 d/ `: j. n- K
: I/ ~+ @6 U% p# h////下面不需改变////////////
! H. y+ n8 ]- K& N0 m$ z. @' m4 n6 c+ C
var copyspeed=marqueespeed
6 d: a3 _2 N/ a: [: Svar pausespeed=(pauseit==0)? copyspeed: 0
* f/ [2 Q7 x( g# h. H4 @* P$ P8 `var iedom=document.all||document.getElementById# B7 G* Q- q5 l0 D
if (iedom)
4 Z9 y) \; u0 ]- Zdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')$ u+ Q/ o# M% s( S" d% \; l
var actualwidth=''# x/ j4 k) [, m
var cross_marquee, ns_marquee( Q9 W; G" W! a d5 N% k3 V' j
* ^2 t4 o8 o, Y5 n8 Ffunction populate(){* ?5 y+ ]+ M, ~+ f. i& n
if (iedom){7 Z: u2 T( _" Z* A1 ]* C
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee( ^" ~ E0 V, L/ q' ~: C1 H' k
cross_marquee.style.left=marqueewidth+8
" M, e7 ~0 ]2 w- l ^0 `cross_marquee.innerHTML=marqueecontent/ M( s3 d1 i3 }7 T: a
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth3 J: i6 |6 _+ n
}
3 v: y0 O% L) r+ s% J3 q2 Jelse if (document.layers){( F. R M" [5 U
ns_marquee=document.ns_marquee.document.ns_marquee2
, _. \- [. j. @7 j0 O' i1 vns_marquee.left=marqueewidth+84 g9 J' @0 A) |# _
ns_marquee.document.write(marqueecontent)
9 f7 M2 g7 ~' R( }3 `* ~ns_marquee.document.close()1 i, r/ j7 M6 Y
actualwidth=ns_marquee.document.width
- n9 ?, s% T, a7 q" U" R}5 h V' z7 m& Y* v$ w
lefttime=setInterval("scrollmarquee()",20)# d. G( l" h; t, k3 p9 v
}0 X! S$ F% g2 B4 U
window.onload=populate
3 |& s2 Q( F$ H4 ?( Z
, s: c( }& m% @: R7 Yfunction scrollmarquee(){+ w& y% V0 N( i2 d
if (iedom){4 [' m& w: M% N+ {1 }: q
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
% z6 r. B& Q5 @. w3 \3 Tcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed, `5 L7 j3 l' D* M5 V
else
) {0 ^# e" q( R1 R9 Scross_marquee.style.left=marqueewidth+8! J+ e7 C: |- Y# n* }1 G% c
9 c) [5 y- {% o) M}9 y$ P) s# T0 g6 P# X5 k/ s" c
else if (document.layers){6 J* A8 ~+ L ]/ Z
if (ns_marquee.left>(actualwidth*(-1)+8))
( r$ l% j4 g% a, ]) A) S: _, pns_marquee.left-=copyspeed( C# p! h5 A+ f* M' P
else
; D1 Q0 {# e3 Z" ]/ l9 ]8 Bns_marquee.left=marqueewidth+8
+ |) H' ]; {+ }; F- P; G; }4 I}
: W* N) g7 r6 Z: U, Z9 F' t}# ?4 z3 R4 N! M6 w7 q
/ T+ j' X: K; O |: G, _
if (iedom||document.layers){
" H' J, y& a4 {1 wwith (document){
* q* q- V: \2 }; x, ?3 i; y Ldocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')6 y; @' x1 p2 P9 i. Y- e1 G
if (iedom){
$ e0 h4 _ I9 Wwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')0 d, z4 y- z! {9 ^
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
/ }5 l5 V5 m$ uwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
* S, s$ y0 n( O, t7 twrite('</div>')
, H# X: w0 f9 u$ H5 c}
2 p+ a9 E4 @7 N( K Helse if (document.layers){
; a+ ~9 H+ C4 ~write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
. J7 R, F, I; L* W; S8 e' ^write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')9 K& Y) _' S% h9 ]
write('</ilayer>')4 ]4 W* Z6 F+ Z4 e4 e* W
}
0 i W6 y7 M3 x) Bdocument.write('</td></table>')) |/ y$ W8 U% `! z- `7 b
}
) W- C: x7 S8 u( p. ?1 C}
5 A( v5 P% T. ]# y</script> |
|