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

|
网页之跑马灯文字特效
//修改宽度2 I& W- d0 e/ X4 N# O* P1 {
var marqueewidth=300' J7 b; C: {4 L2 d
//高度* Q) ~3 X ]( u6 Y) Z3 w- W# B* U
var marqueeheight=25$ b9 }# k' ]( |6 Q
//速度(1-10)
' D1 h- P5 E$ M) dvar marqueespeed=3; x2 H: F9 L" a" l
//背景颜色2 I" y3 j1 w7 @* y! d
var marqueebgcolor="#FFFFFF"
1 `8 Q2 c9 P% w. u1 t$ {0 A$ L//是否能暂停 (0=no. 1=yes)?( F+ q/ n+ T: ^
var pauseit=15 ]+ c5 z7 z5 y/ h$ @
% S J: n; [& I2 ~' ]# M7 }! C+ s$ M8 i//修改显示内容- \/ D( u8 n2 L1 a! V- b" ~6 h
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
' C" |8 t; y# W1 l9 m4 n5 I5 @
" g- e5 b2 ^% l; D7 _, o( m! ^/ h: J) d8 m/ A$ B
////下面不需改变////////////
; q ^! e5 y+ h3 {; _
3 _& `8 w3 ^- K% B+ \4 B1 qvar copyspeed=marqueespeed" L+ D M% Y5 W" p& {, v/ T2 n' f
var pausespeed=(pauseit==0)? copyspeed: 0
! m5 J* P, o7 E8 v$ ~2 tvar iedom=document.all||document.getElementById. _; F! C0 b* D2 t3 Q: I' w
if (iedom)2 E! W: w& U- ^+ O% D+ u
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
6 }9 u8 Y& a& ]' F4 I0 _8 b$ avar actualwidth=''
9 [ t6 W, f8 `8 _8 q' p" L! n4 e' Vvar cross_marquee, ns_marquee
/ A% I5 K) E7 Z, _5 u/ R. ?- I+ k7 p" b# L7 t
function populate(){
/ g6 ^" ?: ]( [1 |' Iif (iedom){
. B- G/ P0 G' V9 d2 b9 E9 Wcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee8 g2 r0 X- V5 a1 W, B7 Z% P
cross_marquee.style.left=marqueewidth+8
4 H5 [5 K3 ~% k k! e' h! u8 kcross_marquee.innerHTML=marqueecontent: A( B) W9 j7 w) _& f
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth3 @. v( o( C. x
}
2 j# k/ ~- d% q3 S" c4 Lelse if (document.layers){
5 S# I9 `$ j% kns_marquee=document.ns_marquee.document.ns_marquee2
# j c- a7 [, P3 o# vns_marquee.left=marqueewidth+8 \6 I2 `! F6 t' E
ns_marquee.document.write(marqueecontent)1 i$ {, Y2 g. L2 o1 f. {. ^, |% K
ns_marquee.document.close()4 C: ~; {3 k$ ]& R
actualwidth=ns_marquee.document.width; v/ H! Z4 c( {, y
}
5 f0 W) U) p! V0 }, Blefttime=setInterval("scrollmarquee()",20); |8 k. x9 R' o/ u9 r7 M
}2 i- N9 v' t/ g+ F
window.onload=populate6 }( F& t; U4 a3 f( m0 j
3 k; k2 H; x+ R2 m
function scrollmarquee(){' ^: Q# V7 E( n/ {7 v q2 _
if (iedom){
/ p. h) k5 H4 vif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
5 m. G! A' R2 @3 u5 N3 ncross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed$ \2 s: ~0 a0 X; ?
else z9 c, r0 s) S/ b* m$ G1 M
cross_marquee.style.left=marqueewidth+8: P% d E4 e# o' J
# I! @, d* _9 k+ k
}
, Z' }4 v" a! I" L- Selse if (document.layers){
' M/ {3 J, R# Jif (ns_marquee.left>(actualwidth*(-1)+8))
, W% J& |$ E$ V* f/ ?" ons_marquee.left-=copyspeed
: c5 g; `; Z1 Nelse" j' ^1 ]+ K# I. _5 Q
ns_marquee.left=marqueewidth+8" \% C1 p! `- b9 S9 a
}
; N( r4 H4 q- Q% e4 L}
, f8 U% f) P5 Y% u
. n1 _; h5 J0 k: w) F) P- s& Fif (iedom||document.layers){
x, V7 I9 s o, V% J1 pwith (document){% {2 J/ s; b9 G! N: {& v3 U
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
% k1 r7 {2 K0 B% A# u% Iif (iedom){/ x& O- H1 o1 Y
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
. a/ g, r; U" u7 Mwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
5 w# e, } a/ b* M7 twrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
( e2 g8 v4 f6 A: s9 X/ Kwrite('</div>') A1 L' a7 D. U0 g- N8 i9 c
}$ N. @6 I3 ]+ {8 g
else if (document.layers){
) H8 G* f8 c" W6 |0 mwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
& Z% J5 V' c5 k! m3 q9 w1 v; E/ ^write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
4 ~; b$ g) Q5 j$ ]7 @+ Mwrite('</ilayer>')( h$ t' B: ?) C8 e
}
; ?! V6 H4 g& f4 I: |5 R+ ndocument.write('</td></table>')0 d2 O1 s. N% t, X& b
}
8 _7 G9 q& j) t: ~0 t+ a}- B3 R) z! K X& p* n0 _2 D( v; b
</script> |
|