返回列表 发帖

网页之跑马灯文字特效

//修改宽度
* l; i7 m& E) @$ f3 Dvar marqueewidth=300. `& S" z8 F/ u+ I, c* v0 W( ?
//高度
: ?) y' y! l( ?4 svar marqueeheight=25" t2 i2 _9 l" T- \
//速度(1-10)& j( y1 d0 x% r# m4 y6 m7 P
var marqueespeed=3
8 v/ @3 V# B( U1 z& B0 c//背景颜色
8 c" _$ r) Y. Z! k5 e8 h( m! ?var marqueebgcolor="#FFFFFF"
0 p$ \- L9 n* \# a" d" W//是否能暂停 (0=no. 1=yes)?
. p( C5 g3 c" h5 g5 _) \" ivar pauseit=1: m% x4 h; I' s# x

3 Q/ }7 G, R, @7 N" h6 }, T. R, t% y//修改显示内容
+ ]: }( z" ~4 _1 gvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
' Z% N/ H/ h$ `8 h1 [
' J- F* l' [* v8 m% f. K0 R. L* m, Q5 W
, V2 _. O: H) v. H1 b& y* x# w# k; D////下面不需改变////////////0 C1 U8 m, F4 m; _' G

7 C9 n* |8 E+ g) S+ rvar copyspeed=marqueespeed
$ r& t8 _1 V3 e6 x, Yvar pausespeed=(pauseit==0)? copyspeed: 0: u5 y7 r4 o# e6 C3 k, R% O
var iedom=document.all||document.getElementById5 y& ]! u% G/ X( n1 v
if (iedom)  Z1 i& w) f+ f- A
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'): {  S! Y) R5 I& ^
var actualwidth=''
9 @( X5 X- s4 ivar cross_marquee, ns_marquee
$ B; b2 b+ K0 C4 S' ?; S
; e6 ^& w& S# h% z6 W. P! hfunction populate(){
3 f" `- d/ D) H/ v0 w7 ]if (iedom){
7 A$ i( E. V2 k! Icross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
2 M1 c  Z2 f" \7 a6 ncross_marquee.style.left=marqueewidth+83 b6 X8 _  a" A3 }
cross_marquee.innerHTML=marqueecontent
( V  M# x: @3 Y/ K. X3 m* f9 Nactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth. x) _, s: t4 e/ |& H
}& [. z. O0 y! a- j
else if (document.layers){! r/ Z6 ~- J# |0 J3 D
ns_marquee=document.ns_marquee.document.ns_marquee2
5 f0 I& t6 I  H. ons_marquee.left=marqueewidth+8
/ y. ?/ m% w! T% ^, Z% h; c( y8 X3 E$ Yns_marquee.document.write(marqueecontent)
8 |3 f( H/ w  @2 I2 ]5 N, J0 uns_marquee.document.close()
9 F7 A0 \$ S" I1 [$ e7 c5 y- z* vactualwidth=ns_marquee.document.width
8 {/ \' b9 w. a! l+ k6 M) ], `" n}
: H  `, \% m  \$ Xlefttime=setInterval("scrollmarquee()",20)
* G1 \2 t; t7 F1 g}/ N: b6 g' @) a' C; f
window.onload=populate
7 @; u3 M8 ~, j" F; q
" C% H& k! I' b/ p9 N+ e' Zfunction scrollmarquee(){
( L9 [8 k9 q; ?if (iedom){6 \; E4 R# D2 L
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
' e2 j$ v& j% S7 m! c: ecross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed" F2 V9 H/ G) T" L4 R* D
else
* T$ _1 M, V8 R- _4 \; `5 |cross_marquee.style.left=marqueewidth+8% N3 b! m+ F0 R3 N
- n! z: q  m5 |) [
}
8 ^! M; C) T+ x  ^9 u* |; f0 Aelse if (document.layers){, {+ N2 s$ d" b) t4 a
if (ns_marquee.left>(actualwidth*(-1)+8))$ |3 g* A& f( t- H, }
ns_marquee.left-=copyspeed
. y2 ~  W. i7 B* J( E9 @else
  [4 Z( R7 t  W  Z0 xns_marquee.left=marqueewidth+8( z7 `2 {( {1 [9 R, \& w$ f
}
, N6 Z' S- \; m1 W% s' I) d$ @}
" q8 i8 M4 v. W2 g3 o4 j0 Y( _* h: H' Y2 Z: ^- m3 ^
if (iedom||document.layers){
' e  C9 d/ A. wwith (document){; [0 K, t$ T! \; [, D
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
3 r- }' }6 P. Dif (iedom){
& ~6 _# c! D# |; Ywrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
& V3 `' s: W  P' A6 k% \( ~write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')/ G7 k% w4 h- U3 o* P. q. w
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
. d, e" T+ ^. p. bwrite('</div>')
$ x" O$ {& B$ F6 y/ I7 p" e}/ A5 ]' B1 ?/ |* U
else if (document.layers){
0 l: g+ r& ]2 d- C: t' [4 owrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
% e' A8 X, J( M$ [+ N, Pwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')6 C) }9 J1 u9 A
write('</ilayer>')
: }4 J$ P' A& ^% R2 j}
' P7 v( D; |$ q$ @1 O' a2 Z' Kdocument.write('</td></table>')) E" r2 ^" U1 J
}
+ m& J" f  p4 z}
! K( L* @: ?; w7 E</script>

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