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

|
网页之跑马灯文字特效
//修改宽度9 ~' S* k, J% J4 d3 J' A
var marqueewidth=300
& m" L% s6 ~4 U6 k, e! t+ F/ j# a//高度3 N. d- c* @1 y& E- l2 v
var marqueeheight=25, \( e& t* c2 a( a
//速度(1-10); z; c6 A3 C& h3 Z/ `: Z
var marqueespeed=3
5 m& ^" W1 Y/ v" k# n8 U' ~//背景颜色
+ ~! D. E( B" F1 {var marqueebgcolor="#FFFFFF"( T7 h; Y2 [) j
//是否能暂停 (0=no. 1=yes)?# K/ x% q" Z" t
var pauseit=1+ ?! J$ }" o: N( @
+ m8 `' d; E" ?! H3 P% f
//修改显示内容
; \& t8 R& u8 Q( e- _. }4 Jvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
% [3 ]2 m4 F6 `& j2 R5 d! o9 z! ~9 Q0 W/ f# y: L+ P8 H& r% i5 Q2 y
' { k/ I% i2 F/ B. w. S
////下面不需改变////////////, O9 e6 s- N) Y, l9 R2 X
0 ?7 s% U- H* r' S& g( U8 Mvar copyspeed=marqueespeed
0 f) {- F* V" t7 M5 J1 _, L& Ivar pausespeed=(pauseit==0)? copyspeed: 0
! R. ^* G+ W- a: Z$ U. x" p) \var iedom=document.all||document.getElementById" R/ Z7 m$ y! s9 X2 _
if (iedom)9 W4 [. b2 l3 _9 S, y
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'): g; O6 F& ?; \7 K9 h8 y
var actualwidth=''; `% [! n x" V6 p
var cross_marquee, ns_marquee9 g" X5 V# U5 R4 h/ J
' R: Z+ {2 @; t" r# r" I8 o5 Ofunction populate(){
& Y- A! Y$ D- Q2 N( P4 _if (iedom){
1 d* a' j9 J' Jcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
$ ~) N) o N M& [3 @6 Q" ~1 L; L) ?cross_marquee.style.left=marqueewidth+8. J: s2 j5 c! p$ B( m0 T$ P
cross_marquee.innerHTML=marqueecontent# I* x# H) Q! A
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth' x* a# j; z* B/ Q' s4 W9 k' P
}
, B" ~$ n k. x5 Xelse if (document.layers){" B/ u) y# m3 L4 v
ns_marquee=document.ns_marquee.document.ns_marquee2+ o( q" R7 R% ^; M
ns_marquee.left=marqueewidth+83 ~' u7 D( B# T: x& T. M
ns_marquee.document.write(marqueecontent)9 s' b) C+ G: Q" d! S
ns_marquee.document.close()
9 }" H: W& r) N# w* xactualwidth=ns_marquee.document.width
1 \! e# y* G, y6 B& {) U3 c+ l}
X& m) B; e B! Y; O8 {5 m+ f/ ulefttime=setInterval("scrollmarquee()",20)
* x" k; M1 } D7 t}+ m3 C' W( N6 D# n) u3 b
window.onload=populate
5 ~# o! l- r5 U4 s8 j+ E# M: J9 u$ I: G1 }5 G0 |! ?6 g
function scrollmarquee(){
9 ]1 H( v7 @! C' z8 e9 |; `if (iedom){
; h# T9 s6 b4 o: Y' I( aif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))" g( g B. q/ ~2 A9 D5 p$ @9 g
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
5 F; w# @/ g% O* L: welse
4 w. P# I. C0 H$ \3 Dcross_marquee.style.left=marqueewidth+8
8 s$ z( w. k$ v% Q% {# u
. D& H/ J( {: @3 A! J}% o( w+ ?8 L" \- m1 ~& \' j
else if (document.layers){5 H5 M1 a5 }, m* v
if (ns_marquee.left>(actualwidth*(-1)+8))
$ l9 G7 v$ L N& v: m% cns_marquee.left-=copyspeed
) F. E8 |0 u; ~* O* ^else
+ v4 n& r, P0 S' T6 Q! U& ]ns_marquee.left=marqueewidth+8
3 B3 C& n& `7 g& x# c5 H}
% ^0 R8 m7 i$ i: T1 @% G2 O# n+ z}0 q: `3 z }- Q+ N# F+ _# J
5 p5 C3 {2 s1 p$ z4 R2 r5 O
if (iedom||document.layers){
4 o3 D9 k q0 }7 G% W" A$ L0 uwith (document){
8 \* n: J$ T2 z) c7 ?1 B. V& ?2 t% }document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
7 \' z; F/ |$ Wif (iedom){. J* K9 h0 ]5 j! ^. M6 X" y
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')# B1 E. W; j; r% C' C: Q3 @
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')4 L( i3 R4 K& u- _; f
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
8 M9 h' R% s, g1 F: k. Kwrite('</div>')% x/ X h* i0 i0 G5 I
}4 U$ g' w ~% Y X+ o1 _; S, o
else if (document.layers){' B2 [4 y( _! f, z6 H* T, P
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 G) L Y& ?0 k* e
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')$ o0 s# ]# u5 y
write('</ilayer>')) j0 e# n$ F: }; U4 `* C
}
_+ U$ |6 `- l, u+ u# ?/ i# gdocument.write('</td></table>')" s9 D2 F& L% j2 u- X
}
/ |" k, z3 L1 ~}: h' Z' i. y. S9 u
</script> |
|