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

网页之跑马灯文字特效

//修改宽度6 c$ d9 v- r9 p3 w' `) ?$ Z6 z
var marqueewidth=300
4 z, I( \/ `" _4 W1 E0 ?. [//高度; a/ D: F- ~( i+ B: }
var marqueeheight=25) k# G$ s' a" u9 P' |/ o
//速度(1-10)
$ G+ v7 a; G  m+ @var marqueespeed=3
: |4 G* o5 x% K8 M, q& \5 @//背景颜色3 j9 W, M* ]6 p# \
var marqueebgcolor="#FFFFFF"9 `3 Q- M# c9 _  g
//是否能暂停 (0=no. 1=yes)?$ j7 Q& Z+ ?# G8 f; ?$ p
var pauseit=16 x: [; ]* m; T5 h& U1 K$ F2 i

0 X! J) v9 Y0 H//修改显示内容" E% W6 k7 `2 w  H* _: I1 c) x
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'& O; r5 c# x0 ^+ R
) Q: Y( O8 w5 [8 v
: R0 r! O  `* N2 G. r
////下面不需改变////////////+ ^. G% l( C8 U4 Z' C
( w% A7 {# o) |1 e1 y
var copyspeed=marqueespeed0 b' C+ F* {4 o, z4 }9 O$ U
var pausespeed=(pauseit==0)? copyspeed: 03 J( F! R+ |' S3 J
var iedom=document.all||document.getElementById
+ f  d' ]! M! S3 v7 rif (iedom)) i1 ~+ N/ R5 |) P" u+ [0 [6 L
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>'); {- S6 Q- ^9 Y$ |- m% m! c% @( V
var actualwidth=''% s+ e- D0 |5 D4 ?
var cross_marquee, ns_marquee: R7 g% w: d. {% \' L5 a

) g8 p& v! S" N( ]function populate(){
. m5 a' ?' s$ `. }: I# Mif (iedom){
0 ], b4 v! O" i! @cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee+ p9 u0 T4 S- U, X" i
cross_marquee.style.left=marqueewidth+8/ O& `" p6 J; V7 H( _
cross_marquee.innerHTML=marqueecontent
+ y, c% S! X9 i$ B. f5 yactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
4 ?2 f% v# C/ d}
& l  [* |* o- v1 l6 [else if (document.layers){6 F' W8 B! q; R4 c. l( |
ns_marquee=document.ns_marquee.document.ns_marquee2: }4 ]( m* @% P
ns_marquee.left=marqueewidth+8& G; t. T8 C0 c/ t5 v$ O5 S4 @5 O
ns_marquee.document.write(marqueecontent)# c/ g) F0 W, [8 u/ L: _
ns_marquee.document.close()
& G/ x* Y% j' `actualwidth=ns_marquee.document.width* g! n$ J) c- K5 h
}7 d+ u& A  O/ b* d) {
lefttime=setInterval("scrollmarquee()",20). H! S4 e: A  j# E/ m, b* Q
}
  W: a1 ?& O6 e/ _) Z3 Nwindow.onload=populate
+ \$ E. x5 s0 P  p
' r- d+ s6 X. Ifunction scrollmarquee(){
* U9 ]& `# Q- V$ i7 [5 D% u! |, L3 ?if (iedom){- y6 J2 p$ l! `/ K
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))4 t8 W- {/ |! n% D! s# L
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed! g" [! R' Y, N& U& v% H1 \0 X; q* w  W
else
/ s5 r5 F- s3 f6 [cross_marquee.style.left=marqueewidth+8
6 u) k. v, a" z/ u" z0 ?6 D, \
7 F3 }" _! e4 j}( G5 Y4 R% F. I
else if (document.layers){9 @. }4 U3 X4 t, v# G0 G# ^# t
if (ns_marquee.left>(actualwidth*(-1)+8))7 S% P- |* e$ _7 ?$ a# b  T0 |  G8 }
ns_marquee.left-=copyspeed( X2 i8 m# h; R& o5 a
else2 j$ }+ K) G" o3 ]- q
ns_marquee.left=marqueewidth+8
" Z/ i# `; a( U: |- x}% e. y- N0 e6 w  u4 T' r, s3 ?
}' O4 Q: ~8 B% v6 h9 C) i. L

: _" y2 M6 o+ }3 I1 Zif (iedom||document.layers){- f' Y- ~0 f5 w1 I6 G3 b
with (document){
& `' q- S" E- w1 X+ Wdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
; s2 M! i( f$ [* }# mif (iedom){
( t% N9 k/ V. w9 Y- ]write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
6 j5 i' l/ ?- H0 O) z) Hwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
) X0 [  u4 r, q, Zwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')& ~' X6 n( Q  E  n& z0 e/ d$ b
write('</div>')$ T5 H  ^7 d8 S. H( F  ~; c
}
$ t+ E/ Q. a2 Z! X4 Z2 Helse if (document.layers){1 D+ N6 e4 o2 F& Q3 G; e
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
! a$ s/ m4 O1 g. P( ?6 Y% ewrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')" K) ?8 o" s: U
write('</ilayer>')
- a3 `2 K# T- `; p: ^}5 Q( W3 A  Z7 Z8 {
document.write('</td></table>'), y4 E( i) m  t$ g6 Z& w
}# j" J1 t# m! x' v, @) n
}+ t- `7 z4 i" f
</script>

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