返回列表 发帖

网页之跑马灯文字特效

//修改宽度) F# m, x" u, L3 Q1 C9 b  a
var marqueewidth=300
* P' [1 ]0 ~% b' y" `& P6 C//高度
( i/ _% ]! o2 w3 M+ j. z5 K* _9 J4 Avar marqueeheight=25; `- H: F) @; w- p+ V: ?! Y
//速度(1-10)* B: u( ]* D, G6 N* J
var marqueespeed=3
, ^5 s8 q  F/ j1 s: h4 |$ b: r+ ~; h//背景颜色" G1 \* W8 X: G  R
var marqueebgcolor="#FFFFFF"5 n* Y% f7 I. a. u  M0 H0 C0 p
//是否能暂停 (0=no. 1=yes)?
' q8 N* ~8 r2 tvar pauseit=1. C& V; K* c' Y4 l4 P9 E* V

  A# ^8 c! T  ~9 k" F//修改显示内容/ W$ X9 F; l; q2 ^2 h
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
2 m; ]# }: Q9 Z  _, [, ]5 T# U9 |- n2 c  t4 O( p0 P
# U* v* O( G$ `: l/ Z
////下面不需改变////////////* i0 G8 }$ E$ R( a$ w
5 s+ u3 W$ i6 A. R9 g6 @
var copyspeed=marqueespeed' E0 z- E; J/ H, p( z
var pausespeed=(pauseit==0)? copyspeed: 0
. M, K1 }+ K% ]" M- P. r" v; R' ivar iedom=document.all||document.getElementById8 x/ ~) a2 [/ A! c8 b
if (iedom)0 s7 R% C; H% [5 |. ~( s7 Q
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')# {% Q( g' q& m# i5 v5 _
var actualwidth=''
- L2 j. e0 V  ^6 Ivar cross_marquee, ns_marquee
# {$ k0 ^# _- w! I
  T7 w6 O. v; Z5 k3 u; K9 mfunction populate(){# W; V5 t" K: i% l8 Z4 C- `. Y
if (iedom){/ H7 p) q6 l6 F8 R+ b
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee1 g( r9 B6 V# R5 @% [6 E9 ]
cross_marquee.style.left=marqueewidth+8& x, [: S2 @+ K$ K
cross_marquee.innerHTML=marqueecontent$ ^1 P, Y' Q, J6 D' h5 K
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth* V& Q2 J, ?& I# F2 |
}- \, \$ t  V$ P0 ~
else if (document.layers){7 }! d% p: \/ v" H+ _* \8 C
ns_marquee=document.ns_marquee.document.ns_marquee23 I  l" u2 M$ L- v! U
ns_marquee.left=marqueewidth+8
7 j( N/ p9 o2 p' @, a$ tns_marquee.document.write(marqueecontent)
. g$ U( r" W% n& G0 g1 D$ Z- }ns_marquee.document.close()
6 I- M  d# k5 @5 W8 ?actualwidth=ns_marquee.document.width
% e# ?! V, z0 y; B}) A/ Z( j! h5 V
lefttime=setInterval("scrollmarquee()",20)
+ \  r; P  Y2 K4 m# a7 j, s) I}
$ O9 H8 D" a6 |. T# d- i1 W& k2 fwindow.onload=populate" V+ e  A3 n) Z1 h: E9 P4 _
2 Y& p7 y& e" H" b1 ], J2 p
function scrollmarquee(){2 `6 z+ _. }6 Y7 e1 w- A
if (iedom){; \. G* p9 w$ j+ K9 b
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))6 M" `! a0 S7 _
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed) a7 x, _9 X0 y" K& H
else
+ G5 `' u# _1 q% d+ y7 across_marquee.style.left=marqueewidth+8
3 x) @' A2 J0 v8 g# y5 f- `5 P  N
9 y8 f8 f8 e+ \& e8 ]}7 G/ k/ Q9 _8 W" Z* `1 W3 K
else if (document.layers){( ]0 {/ K: p% \' \
if (ns_marquee.left>(actualwidth*(-1)+8))
* G* G% E# g' c; V+ V$ rns_marquee.left-=copyspeed
. x1 e6 ~- I, q: gelse
+ l6 `; X( h, {& Z$ Fns_marquee.left=marqueewidth+85 {! T7 O; G& y/ y1 L7 l# U3 j
}" u: W- H6 x) ?6 W2 E0 S( |
}; N0 D' n0 P4 g

: n. x6 U/ K2 Lif (iedom||document.layers){
- K& _8 I: Q/ Q" E  B& Vwith (document){
$ o+ {; v" O1 W' E$ }: B0 edocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
$ D3 f7 d6 o1 U, yif (iedom){# j" ^; Z# S5 Y
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
. V8 K  e' e$ a4 t; Dwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
& b% A7 A3 z6 _" ^6 \5 swrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')& w4 ?4 o" G  {+ i0 k4 b; l, \4 f! b
write('</div>')
- @$ d$ n; q4 N}
" T* f! Z6 W5 T- o& relse if (document.layers){
2 Y  U) Z! Z5 \8 `5 Vwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')" S+ d, g1 K0 o
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')2 d# h3 O5 s! `) P8 E1 a
write('</ilayer>')
' P! X% J- H; p' Z}4 O5 _4 i) H: b1 o) M
document.write('</td></table>'): Z) S; w! i: x& U1 \) |" T
}+ n* W$ r: o' _5 c
}
% S2 N/ ]& L3 R</script>

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