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

|
网页之跑马灯文字特效
//修改宽度2 H! @5 E: A- Y" V( Q/ S
var marqueewidth=300
+ S2 `5 m8 S' u//高度
$ P/ P( j8 m& `5 L+ b: l' t( }var marqueeheight=25
" f+ w( b2 ?" ^7 x//速度(1-10)
4 Y' @( f) G5 f' A/ ^; Bvar marqueespeed=37 z- g2 D/ [4 { O: G9 ]- d# c
//背景颜色% D. S' ?$ a6 c$ ?( C: s6 B3 J
var marqueebgcolor="#FFFFFF"
" R/ q* z! q* k7 G% a5 N: y//是否能暂停 (0=no. 1=yes)?
# u- z7 W# O; r* `3 tvar pauseit=1" v7 h# X* H# c
4 ?9 e; C* Z# \( [6 \2 Y. L8 }* _//修改显示内容
( P& C1 j' u( z0 ~var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
% J f B; f) e' L4 u
, D) p6 s0 r" H" |
, B# d6 ]- @4 h9 F////下面不需改变////////////
* p$ @3 j, J+ `, S+ u( |, P, @
. Q% T. s6 K0 s# L: i' ]var copyspeed=marqueespeed
* x# v1 A) v8 O* O) Q7 ?% jvar pausespeed=(pauseit==0)? copyspeed: 0
# U8 }7 D- r" Y. B" Mvar iedom=document.all||document.getElementById
4 e; y. x3 ^( Gif (iedom)( }4 a& q9 N: S( _
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')" [* [; K2 X" T" I0 p
var actualwidth=''. Y5 M. O. S9 {1 [% d
var cross_marquee, ns_marquee
$ I) I8 v5 d; c9 p; @2 v) }& T! L2 N
function populate(){$ f: {+ l7 k- E0 K
if (iedom){0 t- l$ M/ F; ?- {) j
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
* n/ n7 [3 E g5 Q/ S/ M. X2 ~cross_marquee.style.left=marqueewidth+80 w5 N0 s9 v5 a& Y1 T! O D
cross_marquee.innerHTML=marqueecontent
8 z7 d: Z; o! L! Z; [6 z. e5 ]0 Iactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth3 u+ x! q; W) J4 O, e
}
: e7 z$ L" r; r& Zelse if (document.layers){7 }% W% [6 s" k2 E
ns_marquee=document.ns_marquee.document.ns_marquee23 z; T8 g5 G1 }/ s8 Y( n9 m( j
ns_marquee.left=marqueewidth+89 K& X) y& E. m
ns_marquee.document.write(marqueecontent)) g Z* x- p' w" h
ns_marquee.document.close()
& A" X1 C; B: Nactualwidth=ns_marquee.document.width5 v' o4 X! d4 _" e
}
) s; g |. ? q% Elefttime=setInterval("scrollmarquee()",20)
5 \# l* z ~3 x/ \; A}
! G8 [8 ^$ G! {3 C( gwindow.onload=populate% {4 P4 B h3 X' x* s
; C$ h. |) K! |: D( u* Afunction scrollmarquee(){
3 t1 S8 l0 k* I1 s6 z; D' kif (iedom){
. K4 q6 o- W! D/ Z" S3 Tif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))3 a6 N& } Z! H) Y [. \
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed' X1 V) h7 x7 s
else
- d. h I& h& ncross_marquee.style.left=marqueewidth+8' I* m8 G7 {+ ^2 R/ P
- f; T0 k. _5 k+ s}& V7 d9 i1 D* H! M4 {; F
else if (document.layers){
|( V8 R" _3 d5 D( J( C1 Xif (ns_marquee.left>(actualwidth*(-1)+8))
+ r% @. ?$ L$ S; lns_marquee.left-=copyspeed
& q# W% A4 H. n$ u0 selse
" x7 J4 b3 x# fns_marquee.left=marqueewidth+86 O: [/ E, T9 S- K' Y3 }
}
. j" d* T" m& h2 p. l- x}' |0 ?% Q8 D* W& H0 F; ~5 ^' M
( |, g% F& M, N$ d3 C& R# S$ e: Rif (iedom||document.layers){" f% \4 s6 O- A5 \
with (document){
- B1 u) B3 X( c. c8 ~0 H. xdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')& I+ q% w( A1 e3 T8 d6 u
if (iedom){
7 I+ H3 Z$ Q: t' H) n+ ^write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
& w( D1 G/ Q0 N" ^4 Y, N* y& fwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
' e. v* j$ l# s' ?4 {write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
5 P" y L! r2 m" N" xwrite('</div>')
8 U R, D. T8 j& h' m$ f}
. |! C% |# ^1 ^# F# E, h8 M4 relse if (document.layers){
7 J$ ~+ C+ J' cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
0 i. Z1 e' O# E+ a5 S1 d1 ywrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
0 q. ]# g) d% n; v# G# Ywrite('</ilayer>'); p; J3 l' g5 x
}
' j6 C+ r$ O+ ~; s! @! C% I) Fdocument.write('</td></table>')
1 F- C2 r' b/ e, A O6 f}
) K1 b1 b7 u. a9 w6 B# U! J}3 Q0 Y9 n5 a. T6 D
</script> |
|