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

|
网页之跑马灯文字特效
//修改宽度
7 ]+ t* H4 ^ ]8 X! Ovar marqueewidth=3009 m8 R8 s/ g2 T2 V" J' I
//高度8 _: `, g% [: Q( U
var marqueeheight=259 w1 O# Q" u# j# m# }5 b
//速度(1-10)
9 b8 w* T' b9 a3 ?var marqueespeed=3
5 F Q# g/ C7 j% c* `//背景颜色
! e$ c+ X$ {$ z+ f `+ Zvar marqueebgcolor="#FFFFFF"- f2 M- ?) H# u- E
//是否能暂停 (0=no. 1=yes)?
+ Y' ^. u( {5 w+ x. D7 Jvar pauseit=1
* e8 Y* y, P; j8 E( f3 f9 u! g$ a& k9 Z$ A; ~1 O- [
//修改显示内容
% ^! b. E% C1 N6 D ~/ _var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'; \ [# t( b1 `9 |* C- T2 {
/ K4 `+ G$ t6 t6 E" l T( g3 ?) b* F' W3 o4 M. ~+ ^
////下面不需改变////////////0 p! q+ ~" S& H! z
4 E! s8 U+ @5 \" ~/ F9 ]var copyspeed=marqueespeed7 h, ~/ M& |7 r- M) N0 q! N
var pausespeed=(pauseit==0)? copyspeed: 02 t) K. W/ _7 N& C2 O" I+ a- O
var iedom=document.all||document.getElementById
. I! v4 I) i: \* B( ]# K- R" d! j9 iif (iedom)
: Y7 O$ d# h# l3 K6 L1 _+ ?) Hdocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')5 [1 d4 D4 u# k
var actualwidth=''
" k& t( `9 v% \( i# P5 R7 g/ qvar cross_marquee, ns_marquee
7 v) @# C& e1 {
( Z1 {& o7 P1 ~9 U; t6 ?+ afunction populate(){
% o+ g" q' h0 | ^1 F1 iif (iedom){7 \0 G5 B% p' L/ K
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 t' G: y- k, C4 ~/ F1 r. d% S
cross_marquee.style.left=marqueewidth+8# F/ h) ^/ z) n$ H/ Q& B
cross_marquee.innerHTML=marqueecontent3 X6 G ^/ P3 U; f8 k0 w/ J3 C) I
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
+ @) _$ v9 ]4 w* e f' C}
! ?" V3 h/ _, l: @* zelse if (document.layers){
! N: c( F% I$ N( p j. A6 e% V$ Ens_marquee=document.ns_marquee.document.ns_marquee2( c, a) {; I* c' w! p' c& n
ns_marquee.left=marqueewidth+8
9 ?3 O ?3 I) r+ x; V; X/ B" \ns_marquee.document.write(marqueecontent)# T/ p: l% x* S0 Z+ k# k8 E6 e4 u
ns_marquee.document.close()
6 k# t) q8 N( _& K$ Mactualwidth=ns_marquee.document.width
! J# B8 \: K) U4 E# B/ k}. V4 |. D" @2 H/ T2 R4 c
lefttime=setInterval("scrollmarquee()",20)% z- D3 i1 S( A$ e- N
}
$ X9 F7 u! N* @& V" w* e! P8 [window.onload=populate
( j; B, k( @5 X! l+ K, t
" f- L9 s' C3 Y+ l: w e# F* Afunction scrollmarquee(){9 }7 }+ H% N& F; J
if (iedom){: ?% x0 q$ T. t9 F9 `9 i; d
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
, ~, P# Z3 o( Y% u# ]cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
" ~$ v/ G& A* y: F. L) f! }! I6 felse
' [: \8 [3 k. g1 |% P9 c4 Icross_marquee.style.left=marqueewidth+8
8 M* t7 W/ v4 U5 C& @
9 I5 z2 b/ x7 Z m/ D ~6 h}; `0 e x1 ~! T+ I9 Y) G
else if (document.layers){
) l7 }" ~. g0 C7 e2 \if (ns_marquee.left>(actualwidth*(-1)+8))' k( s J/ [# b S
ns_marquee.left-=copyspeed1 _) S+ L/ M$ F ^% ^0 |
else
4 i$ r; O; k7 |# e; `0 gns_marquee.left=marqueewidth+8
4 k. M+ B8 p3 A4 k}
! z: ~0 G$ Z# N; O7 t9 y7 J}# ^$ y+ C( A/ a" F0 h* }1 D
8 Y* F" \6 o- G& n' t$ g
if (iedom||document.layers){8 R6 b; g& a' ^1 ~
with (document){6 S5 \, { f; z& G, G; A
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')5 g3 S- e$ V& m& S2 n, n' l2 E
if (iedom){9 P' j/ H0 R. D$ ~3 r! |
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'): `* l- Z& L. q8 m0 G
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
' e3 M" {$ Q: e: J) m! n- rwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>'), [ L/ y, X( \ Z( y" L( O8 j
write('</div>')* g3 M9 f% |5 ]# o) t9 h( s& } o& M
} w( L" H% [/ R. O
else if (document.layers){
# n6 e/ ^, W4 K- F. o: W8 a8 X/ Iwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
1 C2 d8 C, H( \9 U* P9 wwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')& T5 d( T+ q2 ^, s- a* _) I% Q: k
write('</ilayer>')
. C9 U& i( ^) y}
+ p2 j Q& S; r( q3 Zdocument.write('</td></table>')
4 U: L# R2 Q3 z3 n) F! O+ L1 g" r6 J* ]}
' |* b3 ~4 ~# d}
1 P9 d% ?; t- r# b. c" t$ L3 Y</script> |
|