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

|
网页之跑马灯文字特效
//修改宽度! B. K8 ^7 R/ e+ E) F, Q
var marqueewidth=300
$ C9 y) q L4 u//高度- j# H7 [" @+ n( [! A5 ]7 S) h+ t% b
var marqueeheight=25
, D9 R! ?; y+ J/ G. f3 t' Q/ ^//速度(1-10)) Q }+ S- B9 C, l1 b6 l2 P* ]: L
var marqueespeed=30 _- Q, C2 a; p( O, ]3 ?4 |. D
//背景颜色
) \3 W& C9 T# C* Dvar marqueebgcolor="#FFFFFF"
4 `* O% C. K$ k J9 X' x7 V/ z$ |//是否能暂停 (0=no. 1=yes)?6 P- L% d. Z$ r7 L# s- H
var pauseit=1
+ }' Q2 \: L- c; t. c: x8 @0 S* O6 K" M
//修改显示内容
' J/ k' r: y6 X8 mvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
: ]) }2 R, V3 D7 j1 o6 Q6 b" b o* \
_/ s& Z4 e1 ^////下面不需改变////////////4 M- ]7 `5 e4 X( g
+ ^- F; g5 d0 H2 t- G Nvar copyspeed=marqueespeed
: Y9 y. H5 C% L0 J9 lvar pausespeed=(pauseit==0)? copyspeed: 0. B; d& f1 t8 ^2 I& F- F
var iedom=document.all||document.getElementById
- M8 T# R, f6 K0 @4 |) }if (iedom)
$ z( p$ X% A0 D$ W/ {+ H( h/ J8 zdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
$ H" i4 R0 k% E4 [* ~8 Zvar actualwidth=''
6 |" ~8 p( F9 D2 {var cross_marquee, ns_marquee
. S. _( j% l7 @' Y o7 w$ @
) E! E) L: u* [* I I- {9 _function populate(){, r1 [; L# T6 _) \! z
if (iedom){
: @' G- r4 f5 h# E0 ^cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
' f5 v: D1 i* a( Z8 Ccross_marquee.style.left=marqueewidth+8
8 O0 p! j- H- S4 j( B3 b/ o4 z, ]+ S* Zcross_marquee.innerHTML=marqueecontent
) A1 \. |: F$ M- E+ _actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth9 L) M, c+ }1 N C+ h: g
}
1 ?+ a. K2 u& I2 z. B+ L3 Eelse if (document.layers){- |+ z) _* l9 d( E0 |
ns_marquee=document.ns_marquee.document.ns_marquee2& I6 ~3 V# ?# x% r; h
ns_marquee.left=marqueewidth+8
8 Q$ A* ?: n: gns_marquee.document.write(marqueecontent)
9 X" d$ v! z. K$ _0 c. z8 ^ns_marquee.document.close(); [$ ~0 q1 L6 h2 p+ F: o% w
actualwidth=ns_marquee.document.width
' e; C5 h4 n. N* D}
; p5 Z9 `9 w# I+ I7 U( Plefttime=setInterval("scrollmarquee()",20)
( n* a$ j C! R$ @}, ?+ | }6 Q3 N
window.onload=populate2 `2 ~! I" K% B( n6 o( `% P9 r4 y: p
8 [3 Z8 u, B3 g* N2 Y7 i3 J3 l" ofunction scrollmarquee(){
* q0 r4 Y5 Y. a9 D) ^) }if (iedom){# S1 {5 B$ B! L% w
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 d9 l% l" X6 p# l/ b6 h& p0 T
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 Q. b; I4 `2 q4 m
else
* \6 y0 o# D) n. Dcross_marquee.style.left=marqueewidth+84 d3 \( Z' p. s
6 I+ h0 N- D0 v- f$ o+ p
}/ t, ]4 \7 ~) C. Q
else if (document.layers){5 q- ^' q& k& A- f* R; V
if (ns_marquee.left>(actualwidth*(-1)+8))
) b8 k3 ^) R3 ?5 S. Uns_marquee.left-=copyspeed2 z/ G# D9 u! L1 H% _) g
else! V. j3 @% D& I9 ?# _
ns_marquee.left=marqueewidth+8
~6 n3 E% g! V2 U& S0 J/ \6 v}
9 T/ u$ r9 N. n1 h u}
+ j* m) q) w4 b6 O3 b- J0 c7 _
# q/ M& J$ }& y* j. [) ]if (iedom||document.layers){, _& k X+ l! ?
with (document){2 k. A/ D' N( X+ x( @1 n& k: B. J2 l
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')8 B6 S2 A+ K* d
if (iedom){. x5 P! W4 {% Z. X/ A b
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')0 Z8 M. w" ?% P J
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')3 ]1 D$ ?% C, j# Q# P# s
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')( B( v8 T. u; y3 o [( Y3 c* l
write('</div>')7 ?5 ?9 e! e G# g
}
6 ^- R8 j: `7 t9 s1 B7 Kelse if (document.layers){( ?0 A- n* g+ c
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
3 S% r- n* B6 l$ J$ t4 i# V9 bwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')8 p: Y \$ L! Z* c
write('</ilayer>')& d3 J# j* c" M
}' u; J/ L4 O L6 }
document.write('</td></table>')9 f" \6 t" U- R9 g. |: v0 `" j
}* T' M3 Z- U: m& ~% g
}
' {! X5 I3 b2 g: k</script> |
|