返回列表 发帖

网页之跑马灯文字特效

//修改宽度
9 k0 e6 u3 ~3 [4 a, G& I; Zvar marqueewidth=3009 O1 X; B" ?  O/ }+ N, d9 E+ I
//高度& d" b/ a+ Q$ z% {6 _7 K
var marqueeheight=25( w5 o1 T( B" g' I
//速度(1-10)
3 r7 W  q2 f. y( J/ Xvar marqueespeed=3
6 Z/ v, w( H! ]* g5 l$ M7 F//背景颜色: H1 F$ v  d' L( C0 l& C+ ]. s
var marqueebgcolor="#FFFFFF"
& v9 r& v. w4 f5 N4 L# k//是否能暂停 (0=no. 1=yes)?
0 Y* B* ~! p7 avar pauseit=14 h" Y/ Z, R( {4 J% X  p

' q# y1 w+ ?# i* I0 J$ e6 o& i//修改显示内容: R; c" {0 P* b- Q3 B7 Q
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
( ]! S: x! u3 R7 a* K
8 ^, M" q# y7 Y, [
4 f5 S! S/ `0 F. l# m( v. Y////下面不需改变////////////) V, D8 P7 @0 ^/ S! X

  y$ l: z& s5 g6 m$ a7 wvar copyspeed=marqueespeed& G# A4 F+ t7 ^* `& m, y
var pausespeed=(pauseit==0)? copyspeed: 0* O; W/ u* k3 [6 B
var iedom=document.all||document.getElementById. s+ g' N, O# l( F
if (iedom)5 Z# g0 l+ k: i  J. E+ C2 m
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' o1 L1 Y7 v4 W4 W0 E2 a3 o' |- S9 Q  e
var actualwidth=''" k) C& m$ P. C% f3 s1 S
var cross_marquee, ns_marquee
6 v' X. k; h, D7 W/ |0 _3 D* C, ?+ M* k5 O1 L; v2 u7 u
function populate(){+ \) s( C9 l7 |
if (iedom){+ j0 F; W8 h$ }- q
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee  r, z' R3 |# E" S5 J
cross_marquee.style.left=marqueewidth+8
( y0 M. B& `+ j/ t# lcross_marquee.innerHTML=marqueecontent' t2 r, t' f. V8 S9 T
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
$ X* w( w% t0 Y1 s4 X}3 Q( t/ d" k" L. l+ R$ q
else if (document.layers){2 E# {5 V# m& h6 t; C9 x
ns_marquee=document.ns_marquee.document.ns_marquee2
1 U: x/ q6 A' S% G1 b2 i" Zns_marquee.left=marqueewidth+8  ?" P( P0 \6 e2 ~: X
ns_marquee.document.write(marqueecontent)' [/ ?3 _! u) Q) x
ns_marquee.document.close()
; X/ u" U- E5 xactualwidth=ns_marquee.document.width
; l; w: M3 ^2 z}
5 E6 Z9 ]8 \" R. @+ E' Q; Mlefttime=setInterval("scrollmarquee()",20)
- `) J6 @) p5 n}( R# V7 s  n+ u1 ?  Y0 d
window.onload=populate3 @2 |4 E$ B; [" b  m
+ H( c0 k' n8 k) B/ P9 v: V
function scrollmarquee(){- v( ^8 k8 m- k9 ?; x3 `
if (iedom){* [, b' j2 h! e
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
# ^9 d  u% H4 H8 L; Across_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
6 P0 e. Y1 M' r# Q- {; pelse3 Z+ \( X7 w' Q. |( a  L1 u
cross_marquee.style.left=marqueewidth+8
0 H3 f$ s( B- c5 X6 B  g% D( E5 @: B* r# _
}
( o0 h$ Z5 v7 b5 R5 M2 D2 selse if (document.layers){- X& u  N3 ]4 T! z3 Y3 k
if (ns_marquee.left>(actualwidth*(-1)+8))8 }) Q7 I" Q% `
ns_marquee.left-=copyspeed# ~* s3 U. R" L* H( x
else
& S" u& F8 ]3 M) vns_marquee.left=marqueewidth+8
8 v6 C7 `7 \+ W, a! D6 x6 v! @7 k}7 ^3 ]+ z4 @; [
}7 E& r$ a% C' n. r

, u" C; J# L' f9 U1 N. sif (iedom||document.layers){( Y6 f- G2 A: ^9 f! `
with (document){
/ I% L" T+ Z2 i; N( Edocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
0 M9 ]* Y0 ]2 K" dif (iedom){! f- U7 H. I0 a; k. m
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')% g2 Y2 O& W' \
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
2 a( k& l9 d+ q" k  c: _- [write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
* @% |3 P8 [! j7 `1 Xwrite('</div>')
2 d& h. ], U8 }/ ?- M/ u}% d; l3 g6 }) |5 ?9 l2 Y5 l/ F2 G
else if (document.layers){
4 O+ w4 }: n1 K4 Cwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')) n. i" k, ]4 w- q5 F- n" ^
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')" d: `! o2 S7 D5 ]' e3 K8 x
write('</ilayer>')
. |: r8 l: m! S/ }) A7 _- N) \: d, O}+ s2 f+ X3 L3 J) w/ `; a- ~
document.write('</td></table>')
, U* y: _7 Z1 {9 C0 Q9 p}
7 A% {; n& j% L; Y}
7 X; l# L7 A' V( l- V</script>

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