返回列表 发帖

网页之跑马灯文字特效

//修改宽度$ |; B# N0 E. R' I
var marqueewidth=3009 N, c$ T( `8 R5 u1 V( K
//高度- _( M% ]2 E1 y  O; {
var marqueeheight=25
: B7 e3 x- {4 D$ M5 w' l//速度(1-10)" N( Q* S% k' A# r7 Y. T$ r8 Z
var marqueespeed=30 p5 q8 U% b5 \5 P) Q! d4 |
//背景颜色  _/ d: O2 R# C  l+ T; x6 m
var marqueebgcolor="#FFFFFF"% D% W; e/ _& N0 U; C8 z( P
//是否能暂停 (0=no. 1=yes)?
6 U/ D. d. s, C5 H/ n9 lvar pauseit=1
: ^8 ]. F) k8 f3 O3 d
+ q; b, \0 j2 ]" Q# z//修改显示内容, Y2 w: @9 Z  l& K
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'# A' `- @% }) i3 ?- }0 u
4 X1 ~- V: R/ y# P  `- Z+ }8 \& V

( ^! d5 L$ \3 @. l& R9 i# R////下面不需改变////////////
7 Y& X4 w+ _4 Z3 h' k. Z' \9 H0 }3 b/ j# H9 @
var copyspeed=marqueespeed, a6 j) O$ Q* ], ~) U  i2 z
var pausespeed=(pauseit==0)? copyspeed: 0
& {: p0 y6 V1 mvar iedom=document.all||document.getElementById3 S0 a7 M6 P) M8 h; K
if (iedom)) i% x; W' e( m  _
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')+ n; B5 E2 R/ j0 Z. G7 O
var actualwidth=''
# s: e! G$ X! ]4 K- z: g3 f* jvar cross_marquee, ns_marquee
- J0 O& n8 N0 H, _- _
2 C- J% K7 M$ c( h" c2 |( nfunction populate(){
" V, [$ \3 D1 w5 G+ @( S: eif (iedom){" G+ x4 Q! j: H
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee; p9 F; p, W6 q  f+ y1 m9 b
cross_marquee.style.left=marqueewidth+8
! L. D+ h" b' ?! `. f8 ^4 t  tcross_marquee.innerHTML=marqueecontent
3 {' Z* p. U0 e' C  yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
* k) `0 l; \$ x5 U4 L' S$ ^}+ k4 e# _8 X% V
else if (document.layers){
/ p  B( G2 O7 Z& ~6 v- v$ R- Bns_marquee=document.ns_marquee.document.ns_marquee2$ m% @/ ]  V+ X# O) d7 J" a
ns_marquee.left=marqueewidth+8& {* y6 t/ V/ ~* K& h% P. p
ns_marquee.document.write(marqueecontent), \$ D5 v# E+ O1 X
ns_marquee.document.close()" p  p& P" a: _4 T1 L
actualwidth=ns_marquee.document.width
/ N! `7 S, d5 t8 G6 x}+ d+ N3 u% c0 u, v" c5 z- J
lefttime=setInterval("scrollmarquee()",20)( _" P4 x' V- i% v2 Y
}
$ s9 v' N1 i$ \, nwindow.onload=populate
. U( `3 b- H& y7 x0 z5 ?7 K" _+ F! i$ n( S
function scrollmarquee(){9 f# }  X3 L' ?5 L
if (iedom){
7 m/ D& c5 r4 f4 Lif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))8 g: E% q0 c; V$ ~
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed7 r4 K/ C( s0 S; s" p' W) i
else- ]5 ~. i* A+ g0 ~7 |+ J
cross_marquee.style.left=marqueewidth+8
$ u( ?$ M$ o7 ^  h( N8 G. n- [. z5 B* B" _
}5 Q  U" C) J- ?' u8 s
else if (document.layers){: S1 L7 g" R2 G( I8 X; V
if (ns_marquee.left>(actualwidth*(-1)+8))
' H( a1 h+ \1 g# Qns_marquee.left-=copyspeed5 I* @3 Z8 b& @" d8 `2 g
else
: s; D3 x/ x& |% M7 z4 M, }ns_marquee.left=marqueewidth+8# S6 O9 Y! [/ D
}5 T; M! i' x7 w
}
$ T( z3 B- e- k2 M* [% ]7 `& N( E- D$ @3 ]0 Z
if (iedom||document.layers){) w8 I  Q# F( v, }9 E
with (document){# I% o( q% ?! \, ]7 p+ S
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'): P4 K8 }/ H' E2 t" r
if (iedom){
: H  n4 ]6 M" wwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')5 |( [: Y6 Y1 z+ }3 h
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
: u( ^9 ?; N! F) K% \2 ^6 s6 U' O; zwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')# u2 G% F/ \9 J$ l; D' x2 o- l
write('</div>')
3 m4 S1 S& w) O' w% T7 b  K7 c}! J+ @6 V9 ]2 w8 ~
else if (document.layers){) A/ q3 @1 C0 Q5 x
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
, L9 d, d) E$ E! I4 mwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
5 z: D) b6 R7 o' V$ }write('</ilayer>')
4 H( F# K6 K* Q}
* S& @& y- P) Y; }) j: }# m1 n) adocument.write('</td></table>')# N: a& K4 _7 O1 T1 S8 T
}; c# ]/ _+ b5 h' ^% g( F8 k& v
}2 X0 o( M5 |, X7 a1 C' ?
</script>

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