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

|
网页之跑马灯文字特效
//修改宽度3 L& _$ b7 o v o4 c
var marqueewidth=3007 N+ T3 ^* Q5 Z ~4 i) _
//高度
5 `$ J* T+ P9 ?var marqueeheight=25
# r8 y7 I. g9 I) A, ?//速度(1-10)
2 n% c, q$ ^/ ~$ F) Pvar marqueespeed=3" ^2 i0 H/ w5 ~! h+ _% T o& w
//背景颜色
2 B. c( z7 z) y2 P4 evar marqueebgcolor="#FFFFFF"
; i) G! S- Z0 k( E2 d: `$ C//是否能暂停 (0=no. 1=yes)?
# l& p% h5 u& j& ?2 |var pauseit=1
0 v) r* V" W; x
- H5 t: d3 _- l% f& E, @0 V( j//修改显示内容( ?' |0 p: ~& P3 i' n" E
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
* }& b9 c2 F X" W4 {& \; r1 t, S9 O9 n( i! k! |$ W: }9 l- m( q
; ~1 n2 q" H" l% [) k4 d' P% e////下面不需改变////////////5 E5 k$ ?: [; I
/ A2 C' }+ o, @+ @3 Zvar copyspeed=marqueespeed
$ e: z- ]' I/ @ V$ nvar pausespeed=(pauseit==0)? copyspeed: 0
. z6 q4 D) T& L6 _* B: }8 zvar iedom=document.all||document.getElementById& u0 m J; j/ {& o l# e
if (iedom)
. T$ X; ~5 L6 K( T, s3 G( O0 ~/ Rdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')4 V3 s& T) c( f- D0 @
var actualwidth=''
; P; P. ]& {3 |, M5 r+ g5 f k& {var cross_marquee, ns_marquee
- h0 ^4 v c7 U
_/ r; ?/ O, G+ b0 F/ H8 ~function populate(){
/ G" r q! E y3 a% E) @( j+ t8 jif (iedom){
+ z8 H4 w i/ P) C" }. Dcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
' F4 F8 S8 s2 Z9 }cross_marquee.style.left=marqueewidth+84 _; l1 `9 A; Q2 W# x. Y* v# g
cross_marquee.innerHTML=marqueecontent
6 B6 ~# v/ S0 {7 h* b1 gactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
, C" o8 j8 }/ }$ e2 t4 A}
e, v4 s8 n& j4 e. d2 selse if (document.layers){
: S( Z! d6 @( m# k) Q8 Xns_marquee=document.ns_marquee.document.ns_marquee2% ?7 d' D" A# T0 h w2 _6 g
ns_marquee.left=marqueewidth+83 S( |0 E; D2 f! [" D5 x6 Z
ns_marquee.document.write(marqueecontent)
V* E: c. T( p3 Sns_marquee.document.close()3 M& ` V- H0 d* O5 |
actualwidth=ns_marquee.document.width
4 G1 t1 h" m2 O; T# m}
$ V7 g8 e+ x- r" P3 Blefttime=setInterval("scrollmarquee()",20)' Z4 k% G; ^+ A( f5 b1 x. B9 L
}% W) i# ~, Z" ?* u9 {* Q6 c# g3 A
window.onload=populate
* z9 u4 t" ]: V6 s4 E( { X: } f4 {: c* X
function scrollmarquee(){0 {( [! x8 n, [
if (iedom){
5 L4 ]) N* ?, s* @" Y7 O6 \if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))# h9 \+ }- i, n5 V9 G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed, b1 U0 a% v9 \+ |0 G) \. U' g
else) G: H$ j5 z. m" O
cross_marquee.style.left=marqueewidth+8
/ d: t6 b* e7 c6 M
, H/ ]) ]8 y. ^" f9 ^9 N}
, E v: D1 U# P5 Yelse if (document.layers){" I7 o- y, }$ p8 E' r' q
if (ns_marquee.left>(actualwidth*(-1)+8)), _5 _( T. W) f/ V/ p/ N1 C% ]
ns_marquee.left-=copyspeed
8 ? f+ Y) k1 H" Felse. s% \* F. a, {& P. x
ns_marquee.left=marqueewidth+85 H1 A/ c# W# r) h7 x+ P/ v
}
$ q+ t* R/ B: r2 U& k}( o: G5 O4 C4 S4 l1 Z4 }# ^5 m$ C3 e
2 _6 f$ W4 J/ O- t7 S
if (iedom||document.layers){
5 a' C" H5 @7 ^* xwith (document){! M% l! Q( L7 m( W. Z3 C
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')$ _7 J9 a1 h/ l3 ?3 }2 n1 A
if (iedom){1 _$ n H5 s8 A; u" f8 c' Y
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')6 t- L+ [7 V O: |8 z0 b# @$ t, A" J$ ^
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')! F# Q) e% K1 p/ m% |) A9 E
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')3 Q; D6 `" L: h% f! U% C: Y* V6 R. _
write('</div>')+ P; m1 C: `8 L6 ]: c" i ^ O l/ g6 e
}5 ]( Q( v& W8 Q; a+ Y0 F
else if (document.layers){
1 V8 ^; R$ T* X- mwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
: O, [) ^1 `. \0 {. F& N# xwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')2 g$ j# u) Y3 e
write('</ilayer>')
* V$ {/ l, ~9 y4 h}
! a; E$ ^3 p. U( B; }: s( Udocument.write('</td></table>')
, A: t* ~/ Q/ x* f1 J' @}6 e4 i4 {6 n/ Y$ v7 C2 N! G( |1 P
}
+ r% y* H# b' ^0 H" [</script> |
|