返回列表 发帖

网页之跑马灯文字特效

//修改宽度0 W3 A, R  t  ~7 A
var marqueewidth=3002 j/ D) C5 I. S3 [  e
//高度, z: `* O2 r+ o, o
var marqueeheight=25, O' k7 @: O% `/ q, f! [0 Z
//速度(1-10)
2 f' L4 K) X, r* {# _var marqueespeed=3
8 B) S" F5 w& M/ N- m+ l7 W. u+ Q* i. H  B//背景颜色# Y$ L1 T1 a8 N3 k7 m
var marqueebgcolor="#FFFFFF"  }( g: n" O5 x3 x! F( P
//是否能暂停 (0=no. 1=yes)?+ k$ e; k- \* S1 L* a7 I
var pauseit=13 ^- l) B4 i: \, ^4 x, @. F6 W
% j; @! s9 ]/ K; _# c
//修改显示内容/ x& ~  [  @: [
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'  u4 |9 h" o2 ^6 y/ N

2 I/ t* i; G' A: o
2 K, {8 f. I  H/ j- S* g- G////下面不需改变////////////
4 w2 Q$ p% H0 i! ]: R
2 O4 Y; \: y  `- v8 ?var copyspeed=marqueespeed( c: n/ t2 p- Q1 c' W& F
var pausespeed=(pauseit==0)? copyspeed: 0/ m: f% s6 h" }2 }* ~2 j$ H; Y+ P6 R
var iedom=document.all||document.getElementById
  a8 X* v& K/ L8 l7 Yif (iedom)& Y& `* i' _( m0 W
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
0 q0 w2 ?8 p" j2 q; K3 K+ \; G2 Mvar actualwidth=''+ H, p4 ^- s' H0 X! h/ B) c# W
var cross_marquee, ns_marquee
! G$ D! O+ [9 P4 ?
/ p8 J  Z1 [0 Q! W: Gfunction populate(){: R) N3 r8 ]7 d' \
if (iedom){$ Z9 U: g. K( ~/ s3 z2 T
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee: \# h' R0 W7 t
cross_marquee.style.left=marqueewidth+8
, n0 |  A- a. I; p6 H& Pcross_marquee.innerHTML=marqueecontent3 k9 }, T' ]. C# z. q: R
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth2 c$ ~6 A' d4 w- B5 f
}
5 u/ H6 I/ |+ w: H9 o* E4 Helse if (document.layers){
7 l7 z& M, F' C" q! R# H" r/ Jns_marquee=document.ns_marquee.document.ns_marquee28 v* A7 J4 \0 A- N# [, h
ns_marquee.left=marqueewidth+8
- m1 h5 k" x5 r+ s: y* @ns_marquee.document.write(marqueecontent)) G+ `) g0 l6 c& R
ns_marquee.document.close()
* d3 g' X7 _  C( b+ G& aactualwidth=ns_marquee.document.width6 M; W6 d/ W( o' ^3 k7 R# \
}
5 A# _1 ]+ G0 J. ~! }8 E7 slefttime=setInterval("scrollmarquee()",20)" T1 w# u$ M. t
}8 f/ m9 T( h2 H/ H
window.onload=populate  [1 m2 ^: {- _

! d7 _* F% Z: W+ V& B% c4 f+ {5 o0 xfunction scrollmarquee(){
$ a9 z+ Y+ E  sif (iedom){& {" P' A. k9 d  `
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))% g5 T9 J  T3 G8 N( V# a
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
, S( D+ v- ~/ o4 j1 ?& Lelse$ I. j" i, m  a0 ~+ g' s% \) W
cross_marquee.style.left=marqueewidth+87 P1 R: c6 l7 v6 p& H9 X
( p! }( {7 s) X. S2 G% h4 `3 u
}
" }- {# T: H4 melse if (document.layers){
5 F* L& }4 R: Z  Dif (ns_marquee.left>(actualwidth*(-1)+8))6 f6 c6 o, ?& T" m
ns_marquee.left-=copyspeed" w$ L0 l2 o. U$ E2 y
else% w3 d$ w; ~/ g: C
ns_marquee.left=marqueewidth+8
7 y  B. N8 b5 l# d# q}
9 B# r/ N1 ?6 X% m# U! U}4 w; t  H2 }. K$ r9 S+ O

) F  k" e. L) M0 |% S6 \3 p1 zif (iedom||document.layers){' E7 W' {" {3 o+ A$ G5 P) e& f
with (document){
* @5 I; I2 S0 {. Wdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')+ F  y/ F% g7 A3 R- K0 k  Y
if (iedom){
. @& [, |' F0 rwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')6 W  k' V/ A7 W& x
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')- }3 e. t8 g0 B9 z1 v, u7 I
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')/ X. y/ e- r) e0 }
write('</div>')
+ s' w0 z% T2 v! B) b}
, x6 K, x" K( J- j9 _' y% O" Nelse if (document.layers){% U  e9 c+ `1 M" m
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 {- j$ {( ~' ~; M+ _
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')' G2 v* x. \, R4 S! C
write('</ilayer>')" g: p+ r$ X8 ]1 r; @2 v6 \
}9 G* n" M: B% _6 o
document.write('</td></table>')
- |9 r/ U, e) [% Y1 M6 N5 `}1 N& Z- B0 y. h  t& l5 @& Q
}
; {6 A% Y" A7 n; _</script>

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