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

网页之跑马灯文字特效

//修改宽度' R6 p/ f9 A4 S' g
var marqueewidth=3009 ?! Z; w3 ^( z& h
//高度  b3 V1 j$ C8 o5 Q
var marqueeheight=25. m$ p7 K/ k4 _7 A
//速度(1-10)3 r1 s) n6 G4 B/ A
var marqueespeed=3$ u5 U% k/ W8 D% }8 }9 d
//背景颜色
4 o* b* N1 ~1 u0 L9 ~8 z7 lvar marqueebgcolor="#FFFFFF"; `! I* J9 I$ l/ X* ~
//是否能暂停 (0=no. 1=yes)?
. A4 C) \) S# f. o  c7 V) Hvar pauseit=1" J# |2 v3 F' `# D+ L+ D+ ?- j

1 t! j# q0 b: Z( a- H1 I//修改显示内容
2 ^1 V0 a+ X7 H7 t2 |var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'3 ]& }# ?( B; x% k9 I
+ f$ m/ I; K: c9 A1 x% o7 n* ~4 ~& H
3 R/ L5 ~0 a/ ^' K5 g+ F. r
////下面不需改变////////////$ p, j# D1 o4 o4 |) j7 K" H+ }
6 s4 F& S# y8 D1 U4 `1 a
var copyspeed=marqueespeed2 n# l' H1 n* u4 M
var pausespeed=(pauseit==0)? copyspeed: 0
/ ^6 j0 c( \/ P$ cvar iedom=document.all||document.getElementById+ |. I! {7 k7 \
if (iedom)
% D4 i5 X" u$ r0 ~document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
( V7 x+ l/ ?! _! q3 ]var actualwidth=''
; z' [: H( M6 pvar cross_marquee, ns_marquee; D: e4 M9 }; `2 G
/ x0 t; t3 A& ~0 o0 H! B% s
function populate(){
4 M- G& y* ?3 F+ w( Rif (iedom){
$ z1 j' c% e* c% Lcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
& t: u6 I# q. F0 ycross_marquee.style.left=marqueewidth+8. @+ Y8 D4 b/ ?/ D3 y
cross_marquee.innerHTML=marqueecontent" H; T& o6 h( Y0 Q# j. N7 d4 I
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
. m' ^- o0 h) r) n! ]}
8 X6 G6 g1 v2 R  H: X' O' xelse if (document.layers){
0 n+ i1 r  y# F! B, zns_marquee=document.ns_marquee.document.ns_marquee2
% ]+ Y& j) K7 `4 O6 z7 N  m) Pns_marquee.left=marqueewidth+8
/ s/ U* ^4 l8 W0 [2 D6 t/ E/ [ns_marquee.document.write(marqueecontent)
/ A4 ^" c3 f" s" v+ u0 w- Ans_marquee.document.close()
$ u  ~) ~- V% l/ {8 ]5 }% m, Xactualwidth=ns_marquee.document.width1 m+ W( e8 O' _
}
( G5 ^0 T7 s! ]8 alefttime=setInterval("scrollmarquee()",20)
. O4 j' T# w' I3 h1 A}9 }4 u3 |2 ?0 e# _7 V8 d  d) l
window.onload=populate# X9 A; \9 b, \) I: J* V/ V

+ f, b2 s/ N# W1 Lfunction scrollmarquee(){
- e% p3 U' z8 ~: Iif (iedom){
, H, Z# a6 ]- i# Cif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))6 g$ y+ Y) L8 a. p
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
$ R6 Q. n/ k# H0 q8 P0 ielse) ^& I4 m8 y( H! u( n2 [2 h
cross_marquee.style.left=marqueewidth+8
3 I' s3 Z8 H: ~  ~2 s
: ~6 Y% m$ {7 ]- z9 x}: [3 u. v% M/ t: r
else if (document.layers){$ K! J0 E. \9 y- E5 Z: M& z. F3 F
if (ns_marquee.left>(actualwidth*(-1)+8)). J! p7 X% c+ e# ^( Y+ P: g
ns_marquee.left-=copyspeed
, g0 {* f7 G- Belse
2 K* I- ~" _( B- R1 Jns_marquee.left=marqueewidth+8
* b) w/ {1 S2 Q( P4 f% v2 F}
& S# Z: i/ c7 K  n2 Y( \}
$ K& @" u* @5 I
7 A; C# u3 b$ a( n) ~; Hif (iedom||document.layers){
. C6 J: a3 d9 s9 I3 Gwith (document){
! ^) T$ J% b# W7 h+ K2 r' C% sdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')+ O+ \+ y  k6 _4 _7 _& u
if (iedom){7 I5 z" F5 m9 ?# L
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
9 W/ D, z: ]1 r0 I7 \/ Hwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')$ ^* s3 ]' {9 |) b8 f
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'): Y+ S( R7 F& {% ?$ q  O5 W
write('</div>')+ |& f( D1 C, c' U
}
- {( n' v# @2 Oelse if (document.layers){
* k* }* z9 _0 x/ I3 o; lwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/ k" @9 q0 x& H4 T6 c  }
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
- q# S/ H" u" }$ E; [write('</ilayer>')8 l. D' D1 x. |0 Z+ R/ N6 s
}
, S6 x$ }6 Q7 s. A$ E2 f3 v6 H& Wdocument.write('</td></table>')3 _! E0 ^. D  d. Q
}2 F; H! d2 ]$ o4 t
}
& u* y& j. b- Y. ?& m3 F. U+ P. ?</script>

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