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

|
网页之跑马灯文字特效
//修改宽度
v; S {- J; `% f7 I" f+ K: evar marqueewidth=3006 W8 c9 v1 G. b/ z( w3 z0 X1 N
//高度
) Z l3 T/ @7 xvar marqueeheight=25
: L4 e( S" P; ]3 h$ N9 I* h//速度(1-10)
( L: M1 }/ g! W9 V$ ^ u6 N. Z" d$ \var marqueespeed=3- Y- @. t" n: P2 h( U; }
//背景颜色
/ \9 ]5 K l3 B. svar marqueebgcolor="#FFFFFF"
h/ T: h4 j5 V% `; f//是否能暂停 (0=no. 1=yes)?2 k- M1 C1 a' q! U, u6 L
var pauseit=1
* f. Z/ y6 W1 F) v/ @. \/ ` ^. U9 ~6 H2 J D2 X3 g5 C
//修改显示内容9 U k m4 B# F% D2 S& N9 }
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
- n6 ~+ n- L. m9 _9 c; f7 K, w3 G" Y1 w
. y3 y! A c; S5 V6 V" Z////下面不需改变////////////
& j( i( j) s0 p9 w! t- S% @9 c' S. y# S% N% r/ b0 K
var copyspeed=marqueespeed
7 `& x; _5 s8 U4 }: xvar pausespeed=(pauseit==0)? copyspeed: 0 v2 [! n a" t. P8 H, K
var iedom=document.all||document.getElementById
% W8 [, b K0 {/ cif (iedom)& G! I/ j' t! o) f
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
1 p4 |3 G% w0 wvar actualwidth='', \" K! m2 m2 J, Q& W
var cross_marquee, ns_marquee! b. [! E. `' L4 ?
: i. ~3 |8 O. J7 ^, Kfunction populate(){
% F8 k3 l5 y/ Y- v7 oif (iedom){$ x( u$ d# k0 z
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee ]. L9 o% C6 f7 [0 M( W
cross_marquee.style.left=marqueewidth+8! U) \) C" W1 V) c; a* ^. d
cross_marquee.innerHTML=marqueecontent
, c% u( T% L+ d+ M7 ^8 j+ uactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth: T. R3 N; E* }2 j% @. [
}
7 x. o N3 s" c2 D# R- X8 }& x. Jelse if (document.layers){
! X+ k+ X0 O1 Yns_marquee=document.ns_marquee.document.ns_marquee2$ Q' L7 c: t+ W, ~9 s M
ns_marquee.left=marqueewidth+8
9 p3 ]' t! d7 E, W" I# i, mns_marquee.document.write(marqueecontent)
+ u' j* z5 v$ x5 V6 g- Ins_marquee.document.close()4 T$ P# a O( e& z
actualwidth=ns_marquee.document.width
; C, E& u8 j3 U3 u}
/ L# x) g/ s) G1 Slefttime=setInterval("scrollmarquee()",20)5 j m$ H8 R6 r" Z; I- O
}& j( V& x+ K8 \5 p, H9 d, A( r, i
window.onload=populate
) m5 E6 A. i# C" W U" a, K6 v- G
function scrollmarquee(){, B9 C& z* @8 D% q& ?; i! t' ?" a
if (iedom){
8 `: b+ J. L4 V2 L6 e; y/ iif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
1 r8 O. e; L' ?. N$ D" G. B+ t0 {cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
% x/ ?' _/ x3 l1 m, |5 b l/ aelse
; d! [3 s: T- X. s. [9 Dcross_marquee.style.left=marqueewidth+8- I. f9 y( t4 P+ G8 l. g" N Q
3 a+ U3 | j5 C% @3 h' F _% |9 I9 L}+ d9 R7 _# E* U3 c
else if (document.layers){
, [+ o7 ^/ `4 T% V" zif (ns_marquee.left>(actualwidth*(-1)+8))9 C1 W5 L6 E' q1 k( o/ l
ns_marquee.left-=copyspeed
. D% z. ]6 M6 ~- u! _: n! t, \else$ o9 L% A N4 `3 a- l
ns_marquee.left=marqueewidth+87 X. m% F3 Y, W: ?
}5 z+ j) [7 u9 N" i; k" U
}
* \" C. s: _; d5 M* W) n5 Q0 t+ w; F4 }% I2 I" V
if (iedom||document.layers){
$ i+ t8 _5 Y, c$ U4 Bwith (document){9 K4 W! _( q2 N0 L
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ m, J: [1 V! C+ Iif (iedom){
6 |$ @( m1 d4 F* u0 X+ `) h, Xwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')4 x) l* V# r4 O8 U2 S1 K! }' A& t
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">') o4 D3 n" {( k2 F" C' Q. q, n
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')' z& ]7 [% i" c/ X. D# C; I/ e
write('</div>') p. k" \2 f- L7 Q5 K
}
# |- L0 H+ K M$ E* F" B ]else if (document.layers){2 q% ~2 O+ \9 j( f& Q1 g5 k
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 s! ^* E; e0 Q t" T4 p8 Q$ U9 a
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
7 Z- |4 K! P0 \" w! z- L8 \& S* ?write('</ilayer>')
, Q& d) ]% Z) y% M+ M+ }" ?1 z' f+ p' v}: N, N, e& [. @! W% C( ~8 {. y+ Q
document.write('</td></table>')
% M# {( W, r3 Z; j$ D# @ X P}
# `& m1 h9 V9 P% Y" v8 W}
: |- Y5 ]) N( L: Y/ S( U</script> |
|