返回列表 发帖

网页之跑马灯文字特效

//修改宽度
' o- `1 I; N6 g& O8 vvar marqueewidth=3002 J9 b$ b1 s" Y' H. W  z
//高度$ V& D3 y# S3 Z# |
var marqueeheight=25
/ k9 S4 \3 g) r. L4 K: z//速度(1-10)7 S! X0 r0 A1 f& w) [* {* o
var marqueespeed=3
6 O. a0 L4 F4 \3 t//背景颜色; K3 |* Z& U6 o8 i; Q: t
var marqueebgcolor="#FFFFFF"/ H6 b6 M/ W5 x9 d- a: H  n5 M' |% Z& d
//是否能暂停 (0=no. 1=yes)?' d( T5 X- A6 e
var pauseit=1
$ S% Z2 a5 A. ]; ?: e
5 P9 |% f& u+ O* k& w4 l* D//修改显示内容
7 {3 R- s0 X) v0 A  H6 _; I4 ^$ gvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'# I1 I& m  n1 {* A: {, H7 q0 b
% B3 i1 Z+ {4 ?) Z* b( l

0 J. @; ]! p4 ?1 s////下面不需改变////////////$ O" y5 P0 Z# X- r$ B! U

, A: H( s6 Q6 z  ^1 `  Tvar copyspeed=marqueespeed% ~. a" P2 ?. Q7 V; A1 d4 b
var pausespeed=(pauseit==0)? copyspeed: 0
* `1 o$ B2 {3 x/ O& V5 i' Fvar iedom=document.all||document.getElementById
/ S5 }# @* @1 ?, }9 j) Tif (iedom)+ H; G, z9 T  b- I/ E
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
$ C$ k2 g# s5 S. o% j4 A  r$ lvar actualwidth=''
% Y8 x; {; [7 K0 y4 I" V6 K& K* Cvar cross_marquee, ns_marquee
; ?& X2 \2 e4 v) B0 M
. o& {: m) ~( q5 ~1 Z  }! Gfunction populate(){/ l2 e8 D1 |0 ~0 a
if (iedom){
# p8 ~2 B8 n9 b5 W6 Vcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee1 ~" V# P) g6 o1 r
cross_marquee.style.left=marqueewidth+8
0 M3 ?, u2 P# Xcross_marquee.innerHTML=marqueecontent
/ U4 i4 n% m1 q! B& K. R) Q  yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
$ W+ x* }: E' p  D}' {* F, Y, D9 J* }+ M
else if (document.layers){
$ E9 o, `1 b2 d* W6 j: kns_marquee=document.ns_marquee.document.ns_marquee20 v; Z, I; E$ d9 s' \4 A. V- D
ns_marquee.left=marqueewidth+8
# B% n( \1 [1 \ns_marquee.document.write(marqueecontent)5 U5 {/ \. p- x
ns_marquee.document.close()
6 R  S" h$ R9 z6 q* Pactualwidth=ns_marquee.document.width
/ Q% K6 s# m! b# h+ @5 i# E}
& Z% }+ \. v5 elefttime=setInterval("scrollmarquee()",20)- `9 p$ \& P( a! b; ?
}" x$ K7 l2 b4 R! N1 h3 j
window.onload=populate1 v* F# z( I, d& O- H
. D& Z1 N. M( S% L1 w
function scrollmarquee(){/ D- e5 ^6 S6 T6 G& Q; S- H
if (iedom){
! [+ |  r/ r1 x3 n+ @3 I, V) Vif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
/ i6 M# Z/ A5 u0 C8 g( wcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed8 Q' K2 R* b9 L* T0 t! }+ Z# F0 _
else
' x( k0 c& {5 _* A: Tcross_marquee.style.left=marqueewidth+8" ?6 \2 G/ K" {( w
/ }7 ?7 V  g! t, y, ~, S
}7 y; U- W( ]# O
else if (document.layers){( y! L3 G9 r- l
if (ns_marquee.left>(actualwidth*(-1)+8))
* h4 M! V2 _# {2 L- A( |ns_marquee.left-=copyspeed
5 @7 c; d( S  b1 D$ f4 L2 I& Uelse
) j7 {% h" Y, Ons_marquee.left=marqueewidth+8
& T4 v' G* q; m1 B9 [}. \/ J' \) S' [/ G. w
}
3 Z$ g5 d. j1 H; i5 z
% G* ^3 C! C+ `7 ?3 F8 G8 {if (iedom||document.layers){
: z, E; D( g( D1 rwith (document){" k/ h0 b1 F0 _  Z/ w  ^% z. r9 _
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')1 b9 b$ ?3 d: L; U& s# I
if (iedom){
; L$ t5 M) M6 g' `! q3 u/ |2 c) l: P" Qwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')( P* l# H; S: l- I$ ?; t7 z
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')) ^; @7 Q! R( V4 }
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
) E; G2 a+ d! z7 C2 l3 U7 swrite('</div>')+ t& {9 b: t' O
}" s; Y6 d1 S. k- X4 j
else if (document.layers){
, Z( f: H' S6 @- e2 k1 Iwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
7 I8 |4 D0 M! j$ t" r) c' Rwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
- N( ~* E  t* F; Kwrite('</ilayer>')
# R# F6 y  b/ A}
/ c3 Z1 \' b# s. A9 F0 w( e6 ^document.write('</td></table>')0 U! Q# f: ?5 A- D3 F
}% h* {. S  x5 @! g1 h
}8 i3 a* u* f8 X: O% J' l6 f
</script>

返回列表
【捌玖网络】已经运行: