获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度
$ h- @& U( [6 p2 N2 X4 D3 w+ Jvar marqueewidth=300
/ I. R" I9 T6 G2 _- C//高度
7 y& `5 r7 {& A1 V; W4 p3 }! ^; x% evar marqueeheight=25
( O  L* O6 O2 w$ j/ R: p//速度(1-10)
9 J! H  E6 L6 b. ~1 ~' x3 Jvar marqueespeed=3
" b) P2 S5 \  H, B//背景颜色
9 Q! c' o  ?& C8 ivar marqueebgcolor="#FFFFFF"
% q( c! h. K" W/ B# N: y& h" ?//是否能暂停 (0=no. 1=yes)?
# c4 o7 ]" t1 q9 d9 H6 mvar pauseit=1
# x2 ]5 C- s0 X5 H7 q/ H: \3 M- F* p* l9 S& j9 r( ^9 H
//修改显示内容
& w  _& q1 K# ^" G9 `, Vvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
7 q  W; L4 V, w5 s9 l2 ~7 m6 q" l: L
, l5 t  @* E' M6 q1 y( d2 g
////下面不需改变////////////
! F2 C3 ~7 {& i- Y0 m7 T3 D  Y( H) {, w+ t
var copyspeed=marqueespeed3 P( O- ]/ h  M; l/ q
var pausespeed=(pauseit==0)? copyspeed: 0$ B% ~! z2 M5 E- L$ i+ B
var iedom=document.all||document.getElementById6 ^" {# J0 M8 y- P+ s$ M1 j' m" t
if (iedom)( c$ Z2 D( n) q0 S2 `1 e: M( [9 p
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
8 Q! ?, q/ o. S, {( l* J" M+ Svar actualwidth=''
/ p. Y8 b5 Q& O! I! `7 h! Xvar cross_marquee, ns_marquee" h. f5 N, C' q  g: ~6 z6 C2 V4 X

; L0 v) X% \( H/ W9 vfunction populate(){4 `. F3 t. m: Z/ ]0 x* m9 {4 Z
if (iedom){
; W$ t% j9 P5 W, Qcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
4 x6 X5 d  L, F8 K9 O  u/ ucross_marquee.style.left=marqueewidth+88 K; g4 V6 O/ Z. b
cross_marquee.innerHTML=marqueecontent1 O, k% F" M- K# g9 S$ `
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
, w* I+ Y  V0 [}& u. ]- X9 u; b, {; s+ I
else if (document.layers){
8 w+ v" ^- |' K- [ns_marquee=document.ns_marquee.document.ns_marquee23 K+ c, s1 r8 e! i0 N7 o
ns_marquee.left=marqueewidth+8
! l( U3 ]. A& W( f% l3 R' Fns_marquee.document.write(marqueecontent)
' j0 J  r' Z  m- G. X  q; P# ins_marquee.document.close()
. [, v( z5 h) @7 B4 y: j: u3 jactualwidth=ns_marquee.document.width
" o2 F& F% d* c7 g8 Y8 N% D% C0 c}$ _4 {# J1 q0 m7 {
lefttime=setInterval("scrollmarquee()",20)
) w/ q' ]; w2 X, u; i. c}  y) S+ w" [* u
window.onload=populate* b( W7 {  J7 y! W# w& F2 M$ Y' x
/ C( X- o/ z; v1 K8 p  P; O
function scrollmarquee(){4 v( R2 ]  G' z" z/ d$ v8 f( o9 j
if (iedom){
8 F8 \9 z9 H) h- S" b3 Jif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))0 {5 E$ b: `5 @+ c; L
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
8 l$ P: I3 z9 t, p( b" W$ q6 eelse
% f; [& p  h9 @cross_marquee.style.left=marqueewidth+8$ Q0 x: W7 k/ b% G: z) N# e& r
6 t0 ]! {' k# M4 ^; r7 u
}" j" W/ C; `5 `1 C$ F, Z
else if (document.layers){- ^. v; B; b; ]! F
if (ns_marquee.left>(actualwidth*(-1)+8))% Z' o' G9 N2 v' s% n8 e
ns_marquee.left-=copyspeed
* x3 V  M9 ?2 A7 @8 relse
% [* g6 j) G: Mns_marquee.left=marqueewidth+8
, C' I7 @7 r2 _}
/ _, {* U) V9 @. {+ |}, t: V! |# [9 a7 \+ [
4 B2 w. g* p! [1 X2 M
if (iedom||document.layers){8 y2 s- i3 O0 [/ y6 D# S+ E- f7 n
with (document){
3 h  E; U& w! ~( s: Odocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
& o6 M8 K& ~; J+ t' ]2 B/ x# Jif (iedom){* b! z* |, c6 Z' q; _" ]/ d
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')# X- T2 X. l" y+ d9 u
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')0 r/ Z* G7 D3 Z/ [
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
- `$ A7 z- q0 M& R* ]1 _7 Owrite('</div>')( j5 E2 v: V& t7 S/ i0 f' j2 @
}
5 o6 H2 A, J/ R2 o. e: x1 Oelse if (document.layers){$ f2 R! |; O& E" E( R2 u
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
) k- Y+ k5 M/ ]7 E; bwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# x6 K9 L5 A* p( F6 G) b$ i1 Y" Pwrite('</ilayer>')
( H* L% a% Y  S! }2 i/ O4 X( u3 V( T}4 |: k! w  h9 L3 ^4 R) B1 E2 u/ ?& ~  o
document.write('</td></table>')
6 b6 e$ F# d1 u, i: o; a; ~; p}
2 K: P- u" \6 }5 S2 O( G}
6 J0 r0 ~; w  D# C5 X1 p# h# t</script>

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