返回列表 发帖

网页之跑马灯文字特效

//修改宽度
* [+ @( ~7 p8 A- f5 {( ^  `var marqueewidth=300
( Z3 e6 W. A8 Z; l- P* k; l- @+ e//高度8 |" W# E3 O. ]9 }  m
var marqueeheight=25
# t! l5 @5 D, s! Z% _4 b  i! A//速度(1-10)+ A1 z7 I- u4 N1 D2 \6 ]* w2 g
var marqueespeed=32 ]3 O( I/ e% R, p# V* W, b1 y: R
//背景颜色# J: ^7 F$ G0 k8 \  H; {. V
var marqueebgcolor="#FFFFFF"# Z* _6 X1 b+ n/ ~
//是否能暂停 (0=no. 1=yes)?
. L( W: B+ P8 F- r- P) Q7 ]* u& }var pauseit=17 p5 `- d, t. e# U
1 P6 u; {, ?4 h0 \6 p+ m
//修改显示内容
9 n  Z0 N+ U+ E( y! e  Y% Ovar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
) {/ P# c8 g+ a. ~: b0 y) P! u# z  ~4 v1 ^( M
3 \% a: p' M- ~/ @( Q" c1 K
////下面不需改变////////////7 z3 r0 W, {# E; P2 i: w+ m
" B& s1 z6 I/ q: e# S
var copyspeed=marqueespeed8 J. j6 {! S$ h) t  l7 g
var pausespeed=(pauseit==0)? copyspeed: 0
& _5 K: z6 J5 V& [% bvar iedom=document.all||document.getElementById
5 e5 l! Q+ F0 ?2 F, ]+ Bif (iedom)6 @1 Y0 Q" Z' V, u$ t, a& W
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
5 ^9 T( b: y  V8 n2 s" z* mvar actualwidth=''
- L" @- x5 b( ?  I( vvar cross_marquee, ns_marquee
$ B' K& M& O8 ?! ^, B5 c" H8 t( b/ ?& ~# r: X2 {
function populate(){
8 J# [% ^/ p9 c/ n* Uif (iedom){
2 y/ M& V) ?! n8 o( D) J3 Gcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
9 t+ p' W" e* i. P, U8 S- Y* Tcross_marquee.style.left=marqueewidth+8
4 s# |6 v' s# X: i' e& q+ Q: j9 Icross_marquee.innerHTML=marqueecontent
% c+ A& m, T. Cactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
7 B- G' v: y6 B' }% }+ v}
6 Y" g6 a4 T. n1 Qelse if (document.layers){
! y8 c  n, u( ~  hns_marquee=document.ns_marquee.document.ns_marquee21 T) z) |( v# e" U; k: {
ns_marquee.left=marqueewidth+8, E, W3 r% m6 ]' Z& ], f+ s' M8 w
ns_marquee.document.write(marqueecontent)
+ V* g9 o( o2 ans_marquee.document.close()
, J$ I7 w" t. r# t3 cactualwidth=ns_marquee.document.width: e  M7 ~8 u, Z/ d( o. X
}
0 F7 ]# q6 C2 Mlefttime=setInterval("scrollmarquee()",20)
$ t, @5 ?; ~. Q$ k' B$ X}
9 M- x1 w2 U4 \" y% p. _- k! N& ?window.onload=populate- Z. T, w( \2 b# o4 b0 C

$ a; h/ l5 e: ~6 z0 c- I# n* ?function scrollmarquee(){1 }" o: z) [- S$ K, w( i
if (iedom){1 B& j9 ~6 }$ v; L  [7 m2 z/ o
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
( d% @4 ?3 e% t1 O$ ycross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
6 `$ M, K. y) ~5 W! D0 ?2 lelse! X& `* V, O" L( s/ n5 p
cross_marquee.style.left=marqueewidth+8
& g- Y3 O' p. _4 o3 W& {) X- f1 u- q! v' ^" _" b' p4 d; |
}
! ~8 H; f% O* E0 z; ^! Z% |$ Nelse if (document.layers){
' R; G0 [) D1 \, i% n; Cif (ns_marquee.left>(actualwidth*(-1)+8)): i6 l$ v5 P* T7 {# U9 p
ns_marquee.left-=copyspeed2 v" p  ]* F/ v$ ]+ P
else! [+ c+ Y" u7 v$ c' ]* J$ o) X+ g
ns_marquee.left=marqueewidth+8
( K  \5 ~$ H5 r8 o4 n, f}# J: j! F- Y0 b# |! @
}
2 |7 ~1 o( g" H( p5 N" P% `( {2 W' ^* y" L% H$ G3 @8 L
if (iedom||document.layers){. n! @' W0 G3 r
with (document){
* x$ @, x, J( t5 ~document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')3 n* B5 [  w2 b5 b! ]
if (iedom){3 b* O7 a: D$ S3 |- ~" n0 o+ C
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')& k) H0 c9 X- g/ r1 `2 T/ T. q- Y
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')! T, d; ^% s3 Q. V  k7 V3 f4 a
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
# z. A* s  |- H6 D$ t5 b( L) owrite('</div>')
: z2 I0 V2 ]- N6 ^  f- F}, g! N% D4 A5 B
else if (document.layers){/ X2 K) ~  j' A8 f
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
7 t5 a: o+ c4 O* Ywrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'), P6 P3 t" l+ B3 x, X" Z+ D
write('</ilayer>')" h3 \1 y2 p* V# y$ @
}/ [* o2 {0 ^/ |' G
document.write('</td></table>'). C9 D4 t: F0 x9 T# |3 H- e
}/ H4 f" R+ T2 ~2 G! I' }
}
( a  {4 P, Q/ d/ C+ v2 O  v: q7 ?- x</script>

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