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

|
网页之跑马灯文字特效
//修改宽度4 k7 ?0 q6 P5 R( B
var marqueewidth=3006 d; Z( q7 F- H3 {
//高度
; z+ v9 d& `* R* g6 t' D5 v$ {& Gvar marqueeheight=25
3 D& m3 s* C: L" k4 S//速度(1-10)
! {1 T( h8 q4 G2 C; \7 \ N% r& {var marqueespeed=3
! i6 o2 W, J1 ^) L) \% v5 D//背景颜色
8 b6 b {, q4 R/ R! j" Bvar marqueebgcolor="#FFFFFF"
4 W" Y6 r" Q, ^* J' b1 Z+ U7 |$ R//是否能暂停 (0=no. 1=yes)?0 z/ y7 m! a; p
var pauseit=1
: N. k% U# ^" L' D) w1 O6 H5 U) L# d1 x! L
//修改显示内容7 C) \. |* R( O! y9 g
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
N3 { m* l1 K3 ~2 o* }/ x
! D1 h, P6 K2 N$ s S* q; D0 P9 |5 x* O' @% P3 [! T1 ^$ T
////下面不需改变////////////, ?+ d7 V6 t/ ^0 E$ k
/ g( G- u t/ Wvar copyspeed=marqueespeed
$ @: N6 m9 A: n0 I7 e9 _- @7 d* Dvar pausespeed=(pauseit==0)? copyspeed: 0
. {6 @5 ~$ n) E) ~( kvar iedom=document.all||document.getElementById. R! g8 w& h ]
if (iedom)
- B/ K6 ^& E& `( y' p- P# P- \+ O0 c2 ^document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')$ t2 @2 n$ J0 d7 `/ c! t
var actualwidth=''
5 I8 m4 l& Y& K0 o; vvar cross_marquee, ns_marquee
# e7 G* z# `6 U' N
0 K$ h3 c: T7 [/ Wfunction populate(){' [2 e0 j. F# L7 ?/ P8 N3 y- n" [
if (iedom){
: H7 R* H" s# ]" ucross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
2 a9 L j8 S. Q1 r5 wcross_marquee.style.left=marqueewidth+8
. E% O' F8 t% f" X E& J0 v A7 ccross_marquee.innerHTML=marqueecontent
u' B; x( Y! Bactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth4 n/ T+ @. B- W4 z8 }, @* u
}3 r5 N1 y: s* A9 T
else if (document.layers){
7 e' c$ N* }5 _; w. Sns_marquee=document.ns_marquee.document.ns_marquee2
2 S5 n2 w$ Q. }' mns_marquee.left=marqueewidth+84 m1 E G9 u4 ~" G" a4 _) v
ns_marquee.document.write(marqueecontent)
5 X; L* I1 \9 ^& |# X9 ens_marquee.document.close()
9 s1 T6 W) d( eactualwidth=ns_marquee.document.width: F8 E% ?- e* G) Q+ z) }) _' y
}
6 e+ T2 F5 x8 P4 q. M( \! p1 Ulefttime=setInterval("scrollmarquee()",20)3 }: N5 i2 B* q. L, D' _$ o
}
8 o& Z9 O; S* O% u6 ewindow.onload=populate9 E5 ]) `* v% _% O) I' t" o% ^
) B+ j: z! y% k6 _( U
function scrollmarquee(){
2 v6 g0 b9 R% u$ r4 oif (iedom){* k# W& T. [* D. R5 l1 _; T0 V
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
6 S9 b$ }/ l3 F9 r( X. ?' e1 zcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
; B8 }. }! e9 j! ?) }else$ v' G2 `- L: M6 q7 ]
cross_marquee.style.left=marqueewidth+8
2 }3 S0 U Q4 y, K
5 I. V) ?% z( M6 x C ]3 r8 J" N}5 a! P3 Q8 c- V; M2 g( `
else if (document.layers){
- N1 k3 ]" m/ I2 e$ R ?if (ns_marquee.left>(actualwidth*(-1)+8))- M# E |6 X3 Q. V
ns_marquee.left-=copyspeed
7 V. x% C2 B; N Velse- V* K5 z3 {; x# o; i4 \4 K( a
ns_marquee.left=marqueewidth+8
' D- \$ Y5 V0 o" b}
7 B* W' W5 r9 r* k8 w}
- A: ? N" L- V, ]4 m+ o- X& M/ c- S7 I U" q% A' c7 K+ l7 {3 Y
if (iedom||document.layers){
" ^8 y0 A* [4 X4 }- U: B/ Z* wwith (document){6 _3 ?/ x: d) ?: A5 i Y, N1 W" K
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
* w2 L; l# S5 G6 y1 `7 u" h$ Wif (iedom){
. ?! g: W. t6 K5 X! ?/ D8 hwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')' q* R" I( s/ Q% T
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
. E5 N* h" J8 v- iwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
) _/ C g8 R. w& s/ o7 a( Awrite('</div>')
: S) b6 ~6 S. [}2 H5 b1 Z6 R1 S" Y8 e
else if (document.layers){
5 C9 {; m! h" F% r- z. k7 T0 `! Pwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
3 Z1 H8 z8 L7 t9 x" A+ pwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')* \+ A2 h/ X1 v- n
write('</ilayer>')
5 \; b# b! e1 u1 @5 i1 S}
0 ^8 d# I* E8 o$ S- g" @$ s5 n4 Ndocument.write('</td></table>')1 U* w) l6 H# w# Z# R9 Q1 e! {: R
}1 \; Y+ E0 ~8 d8 F4 v" u$ Y5 X: @
}/ p+ i* K2 ]( @
</script> |
|