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

|
网页之跑马灯文字特效
//修改宽度
1 d3 W9 }! D% evar marqueewidth=300" Y: ~( M7 r1 I9 Q. k
//高度
/ n$ \% o$ q& J/ C, H; mvar marqueeheight=256 _" R- i$ }3 n; h) p
//速度(1-10)
9 J7 h6 G* X) y8 R+ F% \* Dvar marqueespeed=32 K3 j( O# t! ^3 Q0 [- @
//背景颜色
7 P8 q, w+ O+ b4 ivar marqueebgcolor="#FFFFFF"
/ H" f; G# A9 U$ w/ T" C//是否能暂停 (0=no. 1=yes)?$ k" I0 g. q/ Q% c
var pauseit=1
# `+ t4 v! d* F+ \3 S4 p% g% Q5 N. ^% E8 m( m9 D' E5 a% E& }
//修改显示内容
6 f' \* g" k* t! X% L9 Q! P1 j% Mvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
# H" g; V- w% L8 c) e- L, w0 E8 p0 c. f5 o( Y% n/ n3 y5 R
; j0 u) o" s f: o& ]7 g% e////下面不需改变////////////% L: Y" U0 b A$ h. P% g9 x2 `( Z1 z/ C
. D- P* Y4 e% M* m9 _) P& rvar copyspeed=marqueespeed" V6 C4 ^" j1 l+ {1 j3 p* \) F
var pausespeed=(pauseit==0)? copyspeed: 0
$ J I E( e" K& `' Zvar iedom=document.all||document.getElementById. A% d9 `, b/ X5 I; d j: @5 P
if (iedom)# Q3 v. E1 y0 k- `
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')2 N) Y9 c& k# M( F+ k1 m1 V
var actualwidth=''
1 C0 o2 O0 K7 ^2 r5 gvar cross_marquee, ns_marquee
7 b1 ]! E% B" V4 y/ B
C. j5 }- _9 e. D( U. r- lfunction populate(){
+ A+ ]. k( W. h8 r0 O" u8 Pif (iedom){
4 L. k' e4 D2 b+ B: j: R+ `cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee9 i. s8 W* P! x/ @# f+ G
cross_marquee.style.left=marqueewidth+8
2 u) A: B2 S7 L4 ]- I* O/ ?+ Mcross_marquee.innerHTML=marqueecontent
0 a6 ~. o$ p* t% U2 p! }actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth6 j1 ^; Z F R& ]+ Y
}
, z: l8 c5 G. O' E* zelse if (document.layers){
% H) x( q4 F2 wns_marquee=document.ns_marquee.document.ns_marquee2
' O- a7 Q- r! m! l zns_marquee.left=marqueewidth+8
8 c' C# Z( r, O3 Hns_marquee.document.write(marqueecontent)
( ~0 x1 b( A; u. Zns_marquee.document.close() u% i% K* A' d u/ z
actualwidth=ns_marquee.document.width
: ~- D% R4 v: u, {}: b/ x V7 i8 r1 d( g! H# {3 q
lefttime=setInterval("scrollmarquee()",20)
$ E# g M3 g/ Q2 b, j, w}
. e" R; a) g/ swindow.onload=populate5 Z& V& v: J I8 E9 R
' H$ _- B8 H! l0 Q. g* P3 @
function scrollmarquee(){' \/ X$ }2 {- k0 n9 r9 s
if (iedom){( L" k4 y4 O) k! X/ V1 `7 t8 Z
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
! c* S8 C' M# ]# }cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! o+ a! [. u- m+ _- w
else1 L, G! o. w' {, X$ G. j' B& W
cross_marquee.style.left=marqueewidth+87 ~1 c8 u8 e4 g; C& c7 `
3 D: A/ K- Z' r! \}
) h+ W. A0 Z# g. l" c! I0 Xelse if (document.layers){1 |1 k8 H( s, v7 C# C
if (ns_marquee.left>(actualwidth*(-1)+8))# w# V% e3 g, E, Y
ns_marquee.left-=copyspeed
3 Y$ P( R& o) Jelse- u% p, R3 T9 X
ns_marquee.left=marqueewidth+8
% c, i( w7 Y3 e6 R}
/ @- ~1 ~; Y0 ^- Q( `}, A3 | L% {( X) {: R% ~# X- t
9 N# U" e6 M. a7 L- ~$ }) u
if (iedom||document.layers){
9 k. s& m* m0 a; M5 Hwith (document){% u4 k+ v% ~7 D6 }, K
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')' H0 N* H2 q5 n
if (iedom){' H9 F+ t; L! N9 @
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')6 p# g9 C) b! Q1 C2 w7 Y
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')0 Y- V' J& ^8 L, {6 Z# v( w
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
/ Y: S! ?1 [. ~write('</div>')
( H/ N% K4 Z0 S}
/ [$ C- A" _) L$ Z* nelse if (document.layers){
5 I- ?. m' f$ ~: |0 \. Z6 J1 P4 Jwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')& g0 m( b }2 F' p, l
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
A( d$ u+ X( l7 f1 E& Bwrite('</ilayer>')
9 y) d. W9 F y}# R E* A+ v) _! P J5 v
document.write('</td></table>')
* V7 |' {; W- }" a+ ~. ]2 v1 @6 U}
+ M- w7 \$ |, `: X$ Z}+ p, X- v3 D4 G, d# f
</script> |
|