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

|
网页之跑马灯文字特效
//修改宽度; i8 h* o# f* }* S+ @' O
var marqueewidth=300
6 _, P2 R5 n. D//高度
# z# }0 o9 N1 P8 J5 svar marqueeheight=25
3 c0 [0 @: F% F0 E$ k//速度(1-10)
5 }0 E: m3 W0 D2 y) }& mvar marqueespeed=3 ?! k6 p* @# ^% T
//背景颜色3 e* K) t k8 X) V1 |& ~
var marqueebgcolor="#FFFFFF"$ u) e j7 Z) \8 I
//是否能暂停 (0=no. 1=yes)?
, N; I& J/ U, G2 `0 m- gvar pauseit=18 G% t |/ }( p/ ]
' }* P- g& ]/ m0 r9 \! t' g& ^! N2 j
//修改显示内容
0 _1 t4 C. C7 t# ]* Zvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
( ^; X% u6 \% L( \# z1 A% I( f
, c n/ R1 [& k6 d: `
# u" j3 Y5 ^' z8 Q////下面不需改变////////////
2 p% B% _5 F+ Q n: o) ?9 E! i( s. f8 H
var copyspeed=marqueespeed: z! F- i" V* d# ^
var pausespeed=(pauseit==0)? copyspeed: 0
( n% n6 |" P' p0 a5 s3 i6 [+ z' [var iedom=document.all||document.getElementById( i) v' g5 X1 Z! E
if (iedom)- n5 [7 m8 h$ k
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')3 V" U. U$ Z0 r
var actualwidth=''
4 \5 t4 y: [' L7 bvar cross_marquee, ns_marquee% S3 |4 ~. b6 X
) ?" \- c% m+ v' r# ]7 u
function populate(){
, F8 p/ Y i3 e' E8 Cif (iedom){
/ A8 x& P0 _5 S4 H9 G. s2 ~cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
& g# ~8 h% R& J! W* B kcross_marquee.style.left=marqueewidth+8
% A1 b2 M8 Z' T; {6 M5 G9 K* Qcross_marquee.innerHTML=marqueecontent5 I7 K$ ~* t! O& B) B% o
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
# A3 n) s6 S" [2 E& s+ I4 _- a: Z}
^! H+ k+ T7 Q5 i4 u3 velse if (document.layers){
. r) |+ o4 @" N* ` M5 }" Cns_marquee=document.ns_marquee.document.ns_marquee23 v0 X: z/ U: A/ X0 i
ns_marquee.left=marqueewidth+8
0 O: H. S5 }" m. F) xns_marquee.document.write(marqueecontent)+ E( ^( _! q( M1 E, _
ns_marquee.document.close()& p$ j3 p- {( [! w8 x" H+ a j+ J
actualwidth=ns_marquee.document.width
- ` ?3 }5 @; v9 a, k}" s a! ^4 {. \ o Z( b; N
lefttime=setInterval("scrollmarquee()",20)
, P- P/ q. C! e9 w$ H8 @- E}
/ |! o1 u, [: k1 o! ?window.onload=populate
# @; Q& X6 C4 E' x$ h" T# n3 i$ i: c& |! h2 t. w
function scrollmarquee(){
% q2 D* _! N5 R9 M$ {; aif (iedom){
# i E5 O) S- C# ?9 ^& Aif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))1 X9 W6 i' [5 `4 w
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
$ f G0 F. e/ ~4 l# V% Zelse
1 B. E2 y/ p7 n/ Kcross_marquee.style.left=marqueewidth+8/ t$ u6 T ?3 S+ [) m' f/ w# h
# R! H4 n7 K3 D/ r. |}
; S) b" u, }& |8 f. n# b5 @else if (document.layers){9 s+ @$ g3 w8 C
if (ns_marquee.left>(actualwidth*(-1)+8))
& ^6 _! t* A7 A3 s3 {1 Dns_marquee.left-=copyspeed
3 M( B1 n7 s9 M, h2 M" N! t( i3 T. Velse6 K7 U6 `9 J6 y! ?/ |
ns_marquee.left=marqueewidth+8( d" \3 C4 M1 o% w% Q
}. c+ C' Z0 _5 \$ o o& K7 q
}% G* l1 E1 R% b7 K( g5 d7 j# w9 L
- `# |7 d( \4 ?3 y" O. Kif (iedom||document.layers){
& h, z& V% J2 Q1 T% }6 A, R4 uwith (document){* w$ T, B+ t. K, {+ N$ k) K! b: b" q
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; h" {* x4 Q, O; lif (iedom){+ Y' b- l2 u4 _2 P* u1 a2 x
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
2 ]+ e6 c- n1 L4 Ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
: I8 U- C b! mwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
' Z3 l. N& ?- h6 I( {write('</div>')- x% ~' X" a5 V
}$ Y0 F5 _ O" _
else if (document.layers){5 ?7 U$ h% E- Z$ C: p8 r [
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
1 P3 _% p# v" z S$ fwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'), w9 B& q* M9 Y
write('</ilayer>')- i* R2 Z: U- B4 l0 s4 |3 U! A
}! V# T9 ]+ e# s$ S
document.write('</td></table>')) g- V s- o0 k
}. j3 P# ^; B+ q, L2 `; x9 {$ [$ n
}
! L8 d5 t. O$ F2 K$ {7 J& x+ O# F</script> |
|