返回列表 发帖

网页之跑马灯文字特效

//修改宽度
. s4 s  Y% n5 d! P4 h% n: G7 ^/ Dvar marqueewidth=300* C) B6 m, K7 L* o
//高度; q, ^0 P' Y* N
var marqueeheight=25
: X" b" h5 b  t, |0 W$ e) l; a//速度(1-10)
+ Q( c+ G" I2 `& h( W5 M( m3 H- wvar marqueespeed=36 p5 G& r4 b# E3 G
//背景颜色# k( n! c; w+ ]
var marqueebgcolor="#FFFFFF"% `3 g9 u% k$ p, _1 U  _
//是否能暂停 (0=no. 1=yes)?
/ M1 Y; c. \' N6 C. G$ [: p& I6 h' B: fvar pauseit=1
' }* A. A5 R# E; B2 f1 M/ j" d* @+ y$ q2 N. O
//修改显示内容3 p+ Q9 B( z# \
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
1 u3 P3 K! |( A* L0 ?: o
- {0 P9 ~/ U9 C- |( d9 r$ B7 H7 K* r
////下面不需改变////////////5 t& m" x0 E" q7 G8 P9 P6 K

9 Z: E# W; D" ?/ `4 A! O0 Nvar copyspeed=marqueespeed
7 J, P" z' |. }) e: T5 Vvar pausespeed=(pauseit==0)? copyspeed: 0
! O2 h, }- f6 X0 v, w9 J7 @var iedom=document.all||document.getElementById: [- i7 X, Q; W; m0 y
if (iedom)% ~8 c2 K- S( t3 ~8 J% c; k" e
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')6 _3 ~1 R5 O3 r  n- c  _, G* e9 m
var actualwidth=''! }6 n/ X7 [* ?9 c( u; |; T
var cross_marquee, ns_marquee' g/ ~& ]% ]* o
6 e7 I) P' J2 D& z, P) g+ |
function populate(){
' {) r; e! b4 P2 u+ H' I0 Dif (iedom){4 t: ^& j  `; X9 |+ L
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
+ r2 X1 o4 m+ ocross_marquee.style.left=marqueewidth+8, k% i0 M; S9 X8 q" f
cross_marquee.innerHTML=marqueecontent$ K, j( _/ F) m" U+ b; k  g- f
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
  Q6 p. b9 u' b2 `}
3 a5 X! A3 q+ b# ?else if (document.layers){
5 t1 n5 _' Z% G7 V' V5 \ns_marquee=document.ns_marquee.document.ns_marquee2
0 s1 }+ G7 e8 f0 H8 ~7 S7 ins_marquee.left=marqueewidth+8
( x3 K9 Z0 `8 R% Q% t9 r* Uns_marquee.document.write(marqueecontent)
9 y0 j7 X0 u5 d& D$ x$ i9 A' Wns_marquee.document.close()
7 c) ~) Q1 U  a2 lactualwidth=ns_marquee.document.width8 N/ `0 v/ |8 e
}- E- U$ O, K+ Q, H$ f
lefttime=setInterval("scrollmarquee()",20)
$ \! h5 Z+ ]- Q' M; `}6 C+ ]# Y( V8 L( @, o
window.onload=populate8 K9 W8 a2 K3 Q: \. X( e& N
3 Q/ v* ?' s7 N) x
function scrollmarquee(){, o8 h4 ^" w; e1 A% s" B7 X
if (iedom){+ D1 [% C6 z; }0 y! |$ l
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
! B+ \' J( v+ a6 B3 s6 ~3 rcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed4 @/ F  f  _8 H; `) n, D
else' t6 o. z8 c4 {: c
cross_marquee.style.left=marqueewidth+88 f' N8 q3 [; B& k, ?& O4 e

. F) e$ G; `1 r# U4 ^' ~5 Z}1 X' a% d6 e9 L8 W- _8 M- L. ?4 Z
else if (document.layers){
: `8 q% `1 p2 B; P5 \. O. sif (ns_marquee.left>(actualwidth*(-1)+8))/ u1 h) D5 b; @% h1 u
ns_marquee.left-=copyspeed
2 U6 y. O2 p! m: r9 V! L/ Relse
, X- _% T( a4 p% S: k! R9 Vns_marquee.left=marqueewidth+8
8 }* {# f  T% ?+ M7 F+ R! `}
+ |: \4 V* v# i+ ~7 r}
) n0 N% L, S( E. e# B% F* K' s
! Y2 Z  X9 T4 Kif (iedom||document.layers){
$ g* j) U  D% A+ ~with (document){2 ~  G! P' n5 E# i2 h9 \, B
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
$ C: W' m7 A9 l! @* g5 l1 Dif (iedom){7 I# I- O0 ~# ]) ?/ D" ~6 W
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
0 }3 J" j# |$ h; Y9 R* Z" _# f5 ^write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')) F( l1 Q% H9 C
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 H6 W# \: |# b+ Xwrite('</div>')
$ `- l5 _$ j: f& ~0 \; O( _  w  }}6 k( T: D  t' T' o1 g" c$ D
else if (document.layers){
" D' d3 u9 d" w5 s% Owrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')8 @2 K& X  W  C6 g! r, E0 e
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" A/ j1 v) k  J3 F% c$ W5 z! wwrite('</ilayer>')# j. a  u& K+ H) T8 w1 H
}9 j0 p; t" `* t7 y( T% S
document.write('</td></table>')
& ?$ C7 P. C8 v* L}( b0 T' _5 D1 G( M0 O" N$ ]
}
9 n$ b# \+ a5 _' {, K( @</script>

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