获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度+ X& V0 T/ v% X5 p
var marqueewidth=300; P& p8 ]+ I9 R; O" w% [$ A
//高度
* A! D" N2 n0 P, x& A* _; f; Svar marqueeheight=25, \0 ~: a# h$ g; O
//速度(1-10)5 `' u& F4 W; u  s1 z
var marqueespeed=3
9 d' w$ o) _+ E3 c/ }//背景颜色6 V) Q; \' }- }: h
var marqueebgcolor="#FFFFFF"+ I4 w: t9 r) P
//是否能暂停 (0=no. 1=yes)?
5 \( j' Z! \  I- B2 D4 ~var pauseit=1
. ?  J( x- H: ]2 v' @
  u5 f1 ?* M& R//修改显示内容
0 p, T" j5 \5 t3 |) C" Fvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
5 ^- e, P' e+ b+ h! R) T4 c* g) j1 j7 j: S: q% o

7 t- k! u3 P1 K6 F////下面不需改变////////////
4 e! k7 }" o& w! [) h) D
/ b: W' v* X( P# x. Z- M; q: Yvar copyspeed=marqueespeed
" U$ O' j& }: w9 e, J  Q5 cvar pausespeed=(pauseit==0)? copyspeed: 0- n- M" k0 ^/ g3 H+ [
var iedom=document.all||document.getElementById
! V. F7 s5 E6 {, l& @# S5 y* }: y( Lif (iedom)
: U( q* B4 v) S" i5 hdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'): J' C5 F; G& ]- Z  [
var actualwidth='', z6 L# K4 K/ T
var cross_marquee, ns_marquee4 G% O6 ^- w1 n( n
! M; |  E2 N% d
function populate(){1 \- U+ g0 T$ J' [
if (iedom){
$ a( |* Z9 Z3 G! u6 l( Vcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
: n0 r2 x* S# ]4 ccross_marquee.style.left=marqueewidth+8
: k, f# I, ?, U* i3 A3 bcross_marquee.innerHTML=marqueecontent
. F5 ~( n) l& v" [# k3 Vactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
8 \; Y0 ]( e9 s- R# y}0 |% N& K; I$ J: x/ Z( s% t
else if (document.layers){
  Z+ C3 `- W& j5 c7 H/ Rns_marquee=document.ns_marquee.document.ns_marquee2
" }$ Z, [" W& h- A: D1 c$ kns_marquee.left=marqueewidth+8
0 R2 _3 \1 X% U. R( d2 |% Hns_marquee.document.write(marqueecontent)
5 X7 ]" N" o' N" lns_marquee.document.close()5 P  J1 C+ J6 D; ]' m4 U. _
actualwidth=ns_marquee.document.width5 R( z. |/ v% G0 z# q
}
- j5 O9 {+ ]) Y8 E( E) a# Nlefttime=setInterval("scrollmarquee()",20); ]  Y( y/ x& ^8 [9 @
}
! O3 x& P5 f+ k5 F" q+ Qwindow.onload=populate
! h) p& n' Z% k$ |( F
# h  ]0 a* O- E; I. X9 ], l! _9 N0 ?function scrollmarquee(){/ s; s, b& W, c* I
if (iedom){- j( ~* i" w  C" Q$ `; N! I# L+ N
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
8 y5 x* V) b! h$ k" g7 y% Jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed3 O" z( G( z; }0 U; `) a1 t' C
else" N7 @$ h: ?" [; r; z6 p
cross_marquee.style.left=marqueewidth+8
: p$ S$ i9 I! B$ E. |7 o. u1 c$ W/ U9 C/ D3 K
}
- {& c0 [4 j" Aelse if (document.layers){% _9 t  U: N* ~  x6 R; r4 J) n2 f
if (ns_marquee.left>(actualwidth*(-1)+8))
4 u- L$ G( `5 s2 b) t# Y7 ]ns_marquee.left-=copyspeed
; M. p: |5 A2 _* s$ Selse7 l- d* r+ _$ C8 q% @4 z0 B
ns_marquee.left=marqueewidth+8$ e; c4 v# |0 X& \8 D
}" N  }- F$ k5 |; I
}/ z4 \/ j& e5 b% m$ ]& j: N6 C
$ u% m% f; W' g% g/ ~: A4 D! I
if (iedom||document.layers){
0 b4 ]9 A4 ?! p8 h7 Swith (document){6 V) G& H6 ~( M
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')/ R. m. B# C/ u9 ?
if (iedom){; u8 N" Z4 i' i; k0 P
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')7 N2 U. y' }( ?" D  o: P( B* R
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')+ g, v# z8 w3 H4 u! e7 r* E
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'), \9 I$ I3 l- N$ T
write('</div>')6 w* R0 w: D6 q4 }( X- k/ P7 l
}
. o( \& q0 @: W& Zelse if (document.layers){
/ `' i% s: [# ~7 rwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')5 @6 x2 g5 {: j% g: \
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')( I, m) Z  b& b. U
write('</ilayer>')/ t# b+ |4 b; E- h" x
}. b5 U& q; f$ F; `7 X% c5 E
document.write('</td></table>')
$ J/ [  R+ @) w/ l: f. A}
' N% q3 F: e/ H. M" ^- C}/ M' j) g6 R6 c9 U' _
</script>

返回列表
【捌玖网络】已经运行: