返回列表 发帖

网页之跑马灯文字特效

//修改宽度
( A1 b; R% I, j  ?6 Kvar marqueewidth=3008 h* ]# N8 o" Z0 x# z- q* [& P! \$ O( I* \
//高度9 B8 L  f# _# ?! s
var marqueeheight=25
$ i9 K# K0 p. c1 l//速度(1-10)
& F0 q% k2 _! B! f* \, }var marqueespeed=37 c% L7 {( n( |+ j# Q+ R( a
//背景颜色
% u8 e/ ^* E3 o8 p. Zvar marqueebgcolor="#FFFFFF"
! G* t' N+ W0 @//是否能暂停 (0=no. 1=yes)?: s. J+ K3 e, e
var pauseit=1) M: g. T' v/ D0 k- O
( y% ]! x& ~0 F/ v3 R$ p, h* L
//修改显示内容
' ?4 P' u. ~8 g0 f- K$ Nvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
! n  [$ C5 ~: c/ M0 y" y
, Q% d2 v. f; d. K* q
$ A8 z. m  l+ H6 Z9 q1 C# L////下面不需改变////////////
$ Q  o6 D; F) V# o+ [( j8 b
! \* a! P, r% P; {0 k0 m; E! lvar copyspeed=marqueespeed
* {) D, @$ z+ S* X8 ?1 _* Cvar pausespeed=(pauseit==0)? copyspeed: 0
& {' [" i) y/ ]' T! G' y: }# w# Q( Zvar iedom=document.all||document.getElementById9 J5 j, f8 Y3 t/ W$ g, a/ X
if (iedom)
7 a# ^, S5 ~4 F/ D5 ^document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
  x3 A3 E+ D1 a* ]. k7 fvar actualwidth=''
/ s; G8 I7 W$ ovar cross_marquee, ns_marquee
. E; n& P- V9 e$ x7 X, U, g
  ?8 t& o6 ?% K3 b/ _function populate(){0 A7 m' ~/ V3 |) G2 _. j
if (iedom){
9 x6 R2 @$ v6 across_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
- }6 @- k  P: q8 A$ ^( Kcross_marquee.style.left=marqueewidth+8- R3 W2 i) Y3 W, x4 L' N
cross_marquee.innerHTML=marqueecontent
; {% G# T  N" |  {  bactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth1 W# P3 M" U, p& _, O
}# h( j' ^& p5 c3 E* q# N
else if (document.layers){
% k4 o3 @9 q* I( Wns_marquee=document.ns_marquee.document.ns_marquee2& ~. }8 u! W5 V1 |' N, W* c
ns_marquee.left=marqueewidth+8
! E7 d& s  T8 T4 c: ins_marquee.document.write(marqueecontent)
8 a% a0 Z: X+ I. l# D% M3 Rns_marquee.document.close()8 p0 s' m1 Z7 |. [' y2 a
actualwidth=ns_marquee.document.width
, ]3 _. \& _9 e}% ^) T  J* V- n
lefttime=setInterval("scrollmarquee()",20)
% @2 a! Y" ]9 _$ O: r2 M$ G# k6 J  g}
' B+ ?5 r3 P  L+ o1 lwindow.onload=populate! k8 x# E5 W" U; f# B- b

1 ]* J$ G9 b8 @% M: k& a% E7 Nfunction scrollmarquee(){( j) n, R) G% V; q, u, J
if (iedom){
2 V8 `) x0 D, r& B9 A7 G5 f) mif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))% i1 l1 ]: \( @5 `, v
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+ q/ A( |6 g& Z1 b+ }1 i! B# o  e
else
) y+ L0 T& v( gcross_marquee.style.left=marqueewidth+80 o* T2 l/ _' m2 b
( }. J. S; _9 ^  i- @- C
}' B2 u' n8 B% x/ v& ^
else if (document.layers){
4 y+ _! H1 \" @$ c% Y. \! _if (ns_marquee.left>(actualwidth*(-1)+8))% V# _3 l4 G* M! L% d
ns_marquee.left-=copyspeed
$ l4 T1 J0 w0 L' g  \/ Felse
7 p9 [/ \+ K+ S# Y" @" ]+ Rns_marquee.left=marqueewidth+8
1 C" E% H, `' ^+ e. p}
% s" o0 ]$ f) q9 I" g}
8 j4 K0 p! H2 S; u
0 B- T# K" ]6 n+ S4 p# t9 J: Oif (iedom||document.layers){& a) w8 _- h& {6 k& y
with (document){" M# \" Y  R; `' z7 B9 C$ o
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>'): N3 L/ P, {* b) U+ J4 m
if (iedom){9 A, Y6 N8 ~+ M
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')/ z8 U$ g2 Y+ \- ^0 V* n, a
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
0 t8 q9 K/ l! K" B% |write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')" w6 x7 e! d% o$ c5 S. x# }$ ]
write('</div>')! e1 S4 m& s# ~; y' K
}) T7 f, j; F  i  h# A' Q: F
else if (document.layers){5 ^9 _9 }$ n& `, K
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')2 g1 P9 b! e! f6 Z; Y; Y
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')4 A6 x3 h6 Q" n8 M3 Y2 t7 B
write('</ilayer>')% J# C' N6 s( H
}
( I+ b- L  q# S7 z  Ndocument.write('</td></table>')/ P/ A- x% g& t. Z! \. S: W* p* [3 [
}
& C; l6 B, T5 I2 Q}3 j3 M! s* [7 @+ w7 ?! ?( k8 {
</script>

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