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

|
网页之跑马灯文字特效
//修改宽度+ [5 I9 t( W& `6 t
var marqueewidth=3004 a. a/ v( \# x) F, Z
//高度6 p, G; I# r, ^6 k, _$ ^0 c
var marqueeheight=25
: o$ a( [8 B S& ?$ E1 Z//速度(1-10) o, s1 U& `: r8 w
var marqueespeed=3' n B$ ?4 Q9 X* B: C t0 a
//背景颜色
1 Z* k* g1 Z R3 Fvar marqueebgcolor="#FFFFFF"
3 j/ H" S) L( W G) N7 k//是否能暂停 (0=no. 1=yes)?* P6 X2 u; P6 b( v; l8 o
var pauseit=14 D. H2 X& e e0 G
& ^( E, t* x4 Y4 P0 E* Z5 B( d! ]
//修改显示内容
. n! B5 F& X! p Evar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'/ h4 E( u* S( o; b2 X
- t- W# M8 D5 F; C) V/ V. c+ b7 V6 T w5 K9 m& C
////下面不需改变////////////9 B7 x. X4 B) V8 }% n4 g
$ a. ?. e, }1 Q! R1 q; }- `
var copyspeed=marqueespeed0 o1 Q' _- Y. q) w7 `2 P" s
var pausespeed=(pauseit==0)? copyspeed: 0
, |4 o7 m+ ^" Fvar iedom=document.all||document.getElementById
5 i6 L" y) u! \- e e7 ^$ [if (iedom)) D1 }0 ?6 i# s
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 A8 ], W9 \. C5 ~- X1 ]! @, A
var actualwidth=''
. A) Q+ y8 F8 t* D0 u, Z# |var cross_marquee, ns_marquee# |0 X+ A# |+ v3 ?( o; ^
) f# O9 ?1 p- H* |/ J1 L
function populate(){2 a: j- B% G" H7 ^
if (iedom){# G' |. h0 N. o' r
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee4 o; \% B+ N/ a% R% f5 _2 x0 D
cross_marquee.style.left=marqueewidth+8# c/ M) P' b8 ^# x
cross_marquee.innerHTML=marqueecontent( j* U3 n" H4 G$ @) t' y
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
( d1 x3 h. O8 {}0 c9 T6 E! m! @* u; v
else if (document.layers){
& S3 W. u' S/ bns_marquee=document.ns_marquee.document.ns_marquee2- n L4 u" B+ y- z. j. |$ R/ {
ns_marquee.left=marqueewidth+8
|" g9 Z8 m/ R+ Nns_marquee.document.write(marqueecontent)$ T/ j$ }* [3 X& n) T
ns_marquee.document.close()# E% ~% L- Y' }
actualwidth=ns_marquee.document.width. }5 \5 \* M8 P g) x6 M
}
' K7 f$ N/ l T. R+ wlefttime=setInterval("scrollmarquee()",20)) v' G8 U7 n( G$ `% q
}, K" [# r- O: v0 [2 v% B. b
window.onload=populate, s% L: @/ {9 T1 s. z. u {6 l
# A9 t* |5 A" Z0 J4 B
function scrollmarquee(){
4 M3 B6 M. i h# ^; j7 U5 xif (iedom){
8 z8 q: z8 `$ N1 yif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))- y1 H/ @4 R% g0 ]& ^9 L$ L* |
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed% t$ U3 k y! U+ ]1 r7 `1 u: ~6 ]
else& ^/ |" X5 F% [$ a6 C( I
cross_marquee.style.left=marqueewidth+8
2 Z$ S6 P1 K) @' W
/ I( v8 {% G( |}
) B ]8 W! B9 k Z f, v) [2 k* Q, V! Ielse if (document.layers){6 u+ D- ^/ h+ ]' `; c2 B/ B
if (ns_marquee.left>(actualwidth*(-1)+8))
( f3 L0 b8 z6 G( k+ vns_marquee.left-=copyspeed) s# \1 I" b4 ?6 N1 X
else
8 s- r+ V3 f/ q8 Xns_marquee.left=marqueewidth+8# U3 w# T5 h9 W: F4 s; d
}
1 l* f- h3 b* ]" L6 e; _0 A}1 e2 h9 B; C5 `# T/ ^5 w
0 J8 l+ G; C5 d+ {, Y( Gif (iedom||document.layers){
* R* W T. p. z- iwith (document){1 B% `! H1 K9 T& o' _9 M8 z
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'); z* {$ G; w8 S
if (iedom){3 J7 F% G$ W% ~% M8 w6 F$ l
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
- v+ q/ y' b$ g# Uwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
- g6 y2 [. S- j" C4 S8 Q8 ]6 X% g8 kwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')0 ?4 h7 B8 L) i5 F6 j3 K9 l
write('</div>')
) p6 w* z6 C. o7 x, p}
. f: D- W, @3 q! X0 eelse if (document.layers){( j8 G8 D/ _/ d4 d; d
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
! o- c+ T% h; z/ G/ }+ ~0 wwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
% o6 I6 c$ Z7 x3 w* B( S/ P! ^write('</ilayer>')0 p' ~4 k$ `7 t; L, Y B8 r1 H
}; u$ W7 ?8 w3 ^5 F
document.write('</td></table>')
3 G9 |" T7 T% Q$ M% I" e}
+ k1 Y- s% P( [3 h( g, E}* T3 K, k' X2 b* m
</script> |
|