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

|
网页之跑马灯文字特效
//修改宽度8 T% h. C+ K/ A; I+ c0 Z
var marqueewidth=300' s4 ]% l Y/ a6 G# ~; t; X
//高度4 J8 Z2 s- c9 o; {# A% f
var marqueeheight=25
- B4 G2 t( m1 Q$ Y9 o//速度(1-10)) d: h+ T* O2 Y) \/ w; d
var marqueespeed=3
( d h" S5 {* H3 o0 Z" X//背景颜色
# u6 ^, @7 K" U: Z2 N. w2 bvar marqueebgcolor="#FFFFFF"
4 g9 u5 `, E4 s' A5 C6 N//是否能暂停 (0=no. 1=yes)?& M) G4 s+ }) J8 {# X$ s Q
var pauseit=1
" ]! [! G2 V8 A: ^8 e) }
# c* ]0 C) ?$ q" K* _4 E$ ^; ^//修改显示内容
& Y3 t0 }1 C% v; _var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
" A& {* U7 b' [. l! A2 ~5 U- u4 o% S: U3 j$ U$ W, F
( C6 ?# B( U7 e# u* n# I7 r
////下面不需改变////////////
0 f" G0 p3 G. a
J4 z7 G+ J% m% vvar copyspeed=marqueespeed
( c4 V/ o y, ?4 }6 @$ f7 Svar pausespeed=(pauseit==0)? copyspeed: 0
; W& S' K$ R- p7 L* Lvar iedom=document.all||document.getElementById4 j' g# p- r9 z \# f1 n
if (iedom)4 ]# g" W# y7 }
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 `1 j7 J% Z- D/ k
var actualwidth=''
; [3 ]; }9 @* u9 tvar cross_marquee, ns_marquee& t4 }. c1 ?/ d4 x7 w. e6 |
. r6 L6 V. O* U, P2 o( L
function populate(){
- I8 K" R; n. B$ _if (iedom){
5 ^) N. G8 s. a, J! ]* V( i; ucross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee7 Z0 G7 I/ D7 r
cross_marquee.style.left=marqueewidth+8: ?% Y% s) B- h; q4 X
cross_marquee.innerHTML=marqueecontent1 T; P. w9 {' ]3 Z. o
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
% ? `) w7 z+ l! A$ C+ O$ A! G}
& D3 n0 ^( y; v& ^1 V* I7 K$ T, x" v) belse if (document.layers){
; \0 a) ]- w- W& m( |/ [ns_marquee=document.ns_marquee.document.ns_marquee2+ V( j7 N7 |3 r1 B" D1 i; u( V
ns_marquee.left=marqueewidth+8$ r4 m& Y9 P& f" m9 {
ns_marquee.document.write(marqueecontent)
0 b+ n8 e" M" w! Dns_marquee.document.close(); X$ @, d5 @7 m8 Z6 {( m
actualwidth=ns_marquee.document.width
1 {3 z9 I, F6 ^( _4 d}
( t j! M% |- ? K9 L4 [3 ~, E9 dlefttime=setInterval("scrollmarquee()",20)
4 P# e3 b B Z: C+ O# O; }}5 n- l+ O- H% |+ n" W
window.onload=populate
# b8 f4 h5 u7 x) o: j
" i8 \( T2 e& a9 {+ Tfunction scrollmarquee(){- g1 M" d# Y. M
if (iedom){
5 z% [' E9 y7 Jif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))& e3 C+ D1 N( _5 r, {
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 o: x1 D% c" t2 _
else" F) m0 h8 y8 A" o
cross_marquee.style.left=marqueewidth+8
* U& R# ^2 \" r- B1 ]( A0 P! B" t7 f9 O! p2 k% k3 P8 R+ R* Q; Y
}
- [* s! o; b. [2 @else if (document.layers){ p5 S% k0 {' ~
if (ns_marquee.left>(actualwidth*(-1)+8))
9 p3 `9 h, l, ]; z; M% nns_marquee.left-=copyspeed
# ^$ k' `% F$ Jelse
4 Z5 p& ^( B! h/ \) b, I* ins_marquee.left=marqueewidth+8" V$ H, k: j* v4 ]. H. _
}
* y* ?9 J5 W" s8 g% t$ v}
8 I- V2 u8 T& q( m7 A- v2 d
1 c2 w& z" {* F1 F( n' fif (iedom||document.layers){
8 ^3 h7 C7 A% ~) c6 H' b2 U9 D/ r: Qwith (document){& \2 N7 k$ s* ]; m$ r$ x. Y* {
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')/ K+ z4 L/ v- ~
if (iedom){
7 M6 V3 @# p% ~* w/ [$ m" hwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
. c3 |7 I- p# z+ _! q% ?6 q9 C9 nwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
: u/ @4 U7 d- X6 c0 k2 E+ Rwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')$ s3 Y, Q) F/ K- c% Q, _
write('</div>')
* `/ q5 W9 M# x}
y2 W* D2 k: R* Z$ l, v: melse if (document.layers){. a2 s+ R8 B9 [
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')/ D' ?6 i w: c
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')& G# B2 e4 Y9 F$ G; v& k m
write('</ilayer>')
, P5 I% e" j- Q; n+ ?- V8 L: @# J r}
( _ i0 V0 a4 [/ {( D, zdocument.write('</td></table>')
" h! d+ `0 s# N}
; e3 N' |* m. |. M; I}( r& k$ R( t8 A2 K
</script> |
|