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

|
网页之跑马灯文字特效
//修改宽度
0 W" R/ O) ]% R0 P& T3 ovar marqueewidth=3003 U: j5 h8 q1 a5 ^7 d
//高度
0 p% u$ l/ k* |( b/ k& D2 M5 o. A& ?var marqueeheight=25. X/ k" l$ }+ H! |
//速度(1-10)
: k. y. K2 [% _; K% M) c' }var marqueespeed=30 x& x& R9 f4 D1 I
//背景颜色4 y+ \& e( r. _" A T, l) q
var marqueebgcolor="#FFFFFF"
. {9 Y8 h5 o% B; I I [' i//是否能暂停 (0=no. 1=yes)?5 S2 }* }. r3 J4 Z
var pauseit=1
" N) Z+ M5 Q, P; R- g/ Z q" s! s0 M( I: f7 O8 N$ Y
//修改显示内容
M7 x& B: k w5 N' dvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
0 M C( |- q( r- i* l6 n6 D' O6 @1 D* X! g# W3 c3 }
* H. {* E- j$ I! e$ g/ O' y4 Z
////下面不需改变////////////
' R) `9 _* ?, \( @" S( @
, k# P4 B0 z# h. v8 K9 } [& [var copyspeed=marqueespeed4 T e: s3 l7 Y/ N8 O& k
var pausespeed=(pauseit==0)? copyspeed: 03 I9 |! k% L) C6 V m8 W' R0 D' E
var iedom=document.all||document.getElementById& Z: `6 M9 C& Z. y# X; V* F
if (iedom)
d1 q7 ]# f( p ~document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
6 m2 J$ x$ p% L% bvar actualwidth='', ^6 B& U; H0 C C0 q# s0 }
var cross_marquee, ns_marquee5 p4 b( z2 a6 `- f8 q" {5 Y, U
, K! |2 l& k& u) `, N8 i4 w) L Bfunction populate(){, ^7 O7 o; r( W7 B; m: {" R H* \
if (iedom){0 X, P7 u& S% T! ~+ Y
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 ?/ H: \! n2 d$ {. T
cross_marquee.style.left=marqueewidth+80 `) }8 c+ x5 |) p% {
cross_marquee.innerHTML=marqueecontent+ o/ S: j! [$ n5 `7 x: s6 L
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth @6 j. A% |/ j' Z6 v
}
# g9 f! x+ k; b* R. \% D5 }& belse if (document.layers){
& S$ T! e% u2 rns_marquee=document.ns_marquee.document.ns_marquee21 \! n. Q# d% D }" r7 ?7 @ v" ?
ns_marquee.left=marqueewidth+8& u- t* m2 T% ?$ t- y& T( s3 E
ns_marquee.document.write(marqueecontent)
6 |0 S) a8 V$ p' Z( O; N3 Qns_marquee.document.close()
3 I9 Q; ?# h8 P- j% S" mactualwidth=ns_marquee.document.width& A6 H6 }- E& b
}5 S6 K! E& d3 ^9 {4 [
lefttime=setInterval("scrollmarquee()",20)
: r+ e! m; j# K3 q$ a) R2 E}
$ ]! a7 i+ A6 n8 F, g& i* Iwindow.onload=populate* G2 G+ D V" M( h6 n$ Y) [& [/ O6 \
" l4 e0 U! _* L- ^; g% c. m; _function scrollmarquee(){
0 U+ i5 S) ^- u9 f! w6 T# t/ \if (iedom){
7 ?4 P* `9 e0 }if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))7 O3 Z$ ?2 |) o2 r( s$ G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed4 ?3 f1 j4 r1 e+ h2 j7 ~
else
; l& M- d* b0 U: rcross_marquee.style.left=marqueewidth+8" \# ~4 A/ y6 D7 N
& A/ x, y4 T: ]% j}& ?5 z/ S3 v0 v3 W2 F9 y
else if (document.layers){! D& D7 t0 l. e, V& r
if (ns_marquee.left>(actualwidth*(-1)+8))
$ Y. u2 o7 l6 R4 G) {3 x& j; }ns_marquee.left-=copyspeed
( `* W0 F. w% W5 Y- Relse
. R/ n9 K9 c- q9 R: k$ f% Kns_marquee.left=marqueewidth+8
2 y$ K$ \$ f( i5 ?, f2 [}
! ?" H, X4 q* I* j' V$ ~6 R}
+ D0 c& Q" y' q' D* U/ Y; y, j# i$ m% Q: _# H: d( ?3 F
if (iedom||document.layers){
" {- t/ f( H8 ~/ ^2 \with (document){6 @% w8 y$ I# B5 n0 h5 l- _5 L) b/ s
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'). R6 {* ^; _" n/ G6 `8 F) J
if (iedom){
1 P8 K7 J. o9 c+ fwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
1 c' f2 ~- f1 _' E3 W- ~, cwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')" n# h$ j5 R) k; w; _" b) ~' o$ l* f; }
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')' J* L$ n& \. M% Z; s' [- T% ]' Z
write('</div>')% ^' v: z: t$ K! D
}
6 e7 g+ d0 q+ y; `% Melse if (document.layers){0 K/ m( W) r" \; x9 R% h8 o* P9 t
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>') g) I4 _1 I5 c+ `9 Q$ _! v9 \
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ F- O' i. M$ F
write('</ilayer>')9 }' ^9 o+ t' n/ y, h& s
}) ^8 Q9 l P, ~% s
document.write('</td></table>')
w2 g! W0 d, ]3 u) K1 x7 M" S}
" }) p1 g1 M0 E2 _}& q, [- a8 F( O/ J
</script> |
|