返回列表 发帖

网页之跑马灯文字特效

//修改宽度
) c, }4 V9 A' v5 Ovar marqueewidth=3004 C: E$ X* W9 Q( V$ R; f. `$ M
//高度: R6 y! S" \6 n4 Z1 B
var marqueeheight=25
9 ]! u1 ]1 U8 r//速度(1-10)
8 ]5 \8 O5 i. wvar marqueespeed=3
% l. S  R4 d) m3 Y1 \7 b//背景颜色
% t5 S1 t9 Z* p% A' V9 Rvar marqueebgcolor="#FFFFFF"
0 C! J: D/ u' [! G//是否能暂停 (0=no. 1=yes)?
7 C* r5 ?; S5 I& }; K& Z% n6 i9 [$ lvar pauseit=12 i4 c: z- O% G* f9 o7 R, q
3 J( T- A/ L- c: [& T# U4 v! s
//修改显示内容
( @4 L+ T- g0 ivar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
3 n& h$ {) x" k$ `$ _- {& A% N% c5 I
, V; R# m2 l" L
////下面不需改变////////////& l$ Z. L7 Q* G, c2 {4 [/ G8 U
, ~2 `# R  i0 }$ G
var copyspeed=marqueespeed+ j$ P( o' S# }  x5 ^
var pausespeed=(pauseit==0)? copyspeed: 0
  f7 X  ?! _' w% t* u5 Yvar iedom=document.all||document.getElementById4 A+ ^/ L2 W. f! t( t
if (iedom)4 N. y- ^$ X* c7 H
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')' m& Q0 v$ {- n: G' n6 v% I
var actualwidth=''
! ~9 m8 E& t6 I7 F9 ?- d8 Jvar cross_marquee, ns_marquee
8 e2 y- @# F$ z" S  f5 ?: X+ q+ |& w; N* ~; j; s
function populate(){
  [$ Y' B0 n# Z! i; E$ k" A7 G* Qif (iedom){
# v7 F8 ~' b8 b, G2 \7 D4 |$ ^cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee5 F  a9 F$ Q; w% |5 ^; k
cross_marquee.style.left=marqueewidth+8
: T- P3 S. a* }# P2 Kcross_marquee.innerHTML=marqueecontent+ u; C* ]& s# U# _( q
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth5 k3 i! t3 u% q& x  L+ p" V
}" _0 R5 `9 q6 Z  u
else if (document.layers){
2 V7 v/ b0 f  i- X) L; l; ]. nns_marquee=document.ns_marquee.document.ns_marquee2
! U8 r; f6 V& V+ ons_marquee.left=marqueewidth+8* Z6 X; ~* h, Y! Y
ns_marquee.document.write(marqueecontent)1 B2 B) ^9 j% q# {+ M. R" E$ `
ns_marquee.document.close()
2 v% v& x4 x. {actualwidth=ns_marquee.document.width
9 ~, C& c% B# d9 U+ V}
* @/ U4 f. F$ F( a; m1 _lefttime=setInterval("scrollmarquee()",20)
7 R& f& i% p( w1 u5 G}  D( g3 J) W6 N0 J/ f% x1 G
window.onload=populate% D* }6 c  d0 \3 r, o
2 R* o& ]' E3 q9 w+ L% t
function scrollmarquee(){# G) L% o; }9 B2 C- p; V
if (iedom){
# I! j  Q# M7 ?if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))2 b% n# E1 a( T3 f
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
1 _, I1 z- }/ {" @0 J1 e% j+ K2 o# ielse" h6 J% }9 b7 ?3 V
cross_marquee.style.left=marqueewidth+84 D0 u' @- D5 r8 S6 |8 c

' q& d$ V, ?; C# m3 ^! K8 r# {}4 N7 q  ^8 H. \7 Q! H" a
else if (document.layers){
% o4 w, P% A8 B* qif (ns_marquee.left>(actualwidth*(-1)+8))
* G& d7 l# e) h. R" Cns_marquee.left-=copyspeed$ D9 ?9 `, ~7 T" n$ o% ~
else% Q9 E7 ?3 G- {4 p& d# |
ns_marquee.left=marqueewidth+8. h6 i; z, r- ^2 x# {9 K2 R
}0 a- q; T) D8 Z8 ]: v& c0 R& @
}
( U9 b6 q  Y7 |% x6 Y- m4 \
6 g, X- `7 K8 ]; n9 ]if (iedom||document.layers){
; H6 x% ~& k4 t/ R- u; u: nwith (document){
: l8 p. B: I! H& l: v& C" Rdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')7 q5 K) q0 ~/ z- N" }- n
if (iedom){: c" `8 {- @9 U, E+ F( ]
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
, e1 F% H% f% Q- o' |/ s$ pwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')4 K  r4 S1 z9 f  g( n
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')/ @  b8 f  W& X# J* U$ j
write('</div>')! w+ X" U9 w0 n! R; l
}: F' E' r9 Z( b' R" g6 w, s  p
else if (document.layers){% `; G$ P' S4 j+ y6 {
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
5 T6 s, Z1 d" z* G7 B6 Y3 R& rwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
# ^1 `- T- }0 mwrite('</ilayer>')
2 x# i# f+ L5 S$ a}
* U. S0 r* Z( E6 fdocument.write('</td></table>')2 s: c; O  n2 h
}
  w% a2 j8 V: C/ C3 T. I. M}
' J5 W& x* Q( _- g- v- B% }; Z, G</script>

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