返回列表 发帖

网页之跑马灯文字特效

//修改宽度
$ @2 p( w# S8 O; U7 M5 Y2 f5 ]9 r% Evar marqueewidth=300
! c9 S0 B: F: }, {( F; Q; S//高度
- u, t9 u8 p# A& Jvar marqueeheight=25
  f. ~$ g& U- r7 r7 {5 W//速度(1-10)( v  z% n1 q3 v" S
var marqueespeed=3! \7 W* H" z) {* i
//背景颜色
4 D8 R8 n2 U" e4 d2 d! {var marqueebgcolor="#FFFFFF"' |; d; S# h! L$ P1 o9 _! x
//是否能暂停 (0=no. 1=yes)?0 [1 S' g7 ]5 v6 w: I4 C5 o4 Y8 o
var pauseit=1
( R6 D; n6 e! H- J# e/ u  x& N! J. V/ B. I! C2 \! {/ g
//修改显示内容0 T3 a( b" u2 \1 b! m8 L' n
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
) i) f4 X+ D5 j. J: V) T
: e4 \; F' d8 {. A
& p  P, Q9 W6 I8 _& ]6 I/ \% M////下面不需改变////////////
3 {& n# [) d$ f3 Z+ T4 |7 ]9 M. r
var copyspeed=marqueespeed) [1 T9 ^! m7 z8 L- q
var pausespeed=(pauseit==0)? copyspeed: 0
6 g( `2 e- o# a) F" B8 qvar iedom=document.all||document.getElementById
  z9 H+ y- C8 X8 B$ Eif (iedom)& D& X3 Y! A5 F0 a2 M0 z
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
1 ]+ j, _/ d3 ?4 M  M# I4 Jvar actualwidth=''7 h5 X0 U4 c. [9 o' c- z% K/ {
var cross_marquee, ns_marquee
+ c1 m4 y5 z3 @& w8 }* s
+ O' j8 P) X) Y; s) Qfunction populate(){
- F$ o  k0 K6 q: I" q* Gif (iedom){4 l- @2 q5 n0 I* D( f% k
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee  B* ^( q1 k/ H& O! R8 H$ U  R
cross_marquee.style.left=marqueewidth+86 }$ M6 i; z) Q. v; X3 O
cross_marquee.innerHTML=marqueecontent
$ }9 z; o3 u2 A, A# y  dactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
6 r# Q1 ]5 R, u$ [% f# J* X- K2 N}
* _" o/ ~6 q4 D$ |0 r: Helse if (document.layers){0 t# P8 T4 T8 g6 ]- r, }) X
ns_marquee=document.ns_marquee.document.ns_marquee25 B' `0 U3 {* @) f% T
ns_marquee.left=marqueewidth+8
1 e! C1 L5 B1 A$ S( sns_marquee.document.write(marqueecontent)/ |/ ]$ w! j! L4 @$ K( {
ns_marquee.document.close()- O/ N1 i- ?9 K8 i: m. E% [% f
actualwidth=ns_marquee.document.width7 p0 h. _; ~$ s) Z- G2 J  g2 E
}
- _9 e$ y  o* M6 `9 l* j7 flefttime=setInterval("scrollmarquee()",20)
- j7 M- Q9 b$ E1 G0 X/ J; Z( ^! C}' v/ }. i7 G% S/ v4 e5 T+ B
window.onload=populate7 Q' K1 F+ M. k. h

% D; U1 Q! q. U2 C4 {7 S* f$ P5 cfunction scrollmarquee(){
3 e( a, d8 l! A9 }if (iedom){
$ r, a- T. |. j& l& e( @if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))6 Q' p/ P% q$ z9 D4 T0 q( `* k
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed" x- p% z( F0 L# h4 K" }- d
else6 _* J+ f. Q, T! k
cross_marquee.style.left=marqueewidth+88 T/ ?, D7 D) U3 t& \0 P& ?, A
; e+ K6 I& `: k- ~; u% m" B) ^
}: f9 c3 `  Q, ~, N% G8 |. j
else if (document.layers){2 l/ q3 G& R# i
if (ns_marquee.left>(actualwidth*(-1)+8))6 b/ X& ?; ?' l) ~2 ~. a
ns_marquee.left-=copyspeed4 D2 B0 i4 z- R: Y9 p+ K9 S' O0 o& }
else  Q. r  N6 D5 D$ F" X. _
ns_marquee.left=marqueewidth+8( ?8 V3 u: Q6 Q
}2 s3 J1 i- X1 T7 H/ H' }6 X7 E
}
7 S4 }* B# @& k
/ X: S1 Z; T  u& `8 p1 r; F: Oif (iedom||document.layers){
# Q: Q( s& ^- s8 p, [' Q5 owith (document){& b7 Y9 o6 m  ~$ j; ^5 K
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
# N7 v; ?8 K! I- F0 Nif (iedom){
7 C7 e8 k& g. w/ Uwrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')4 P% y7 {& q+ [8 x* ?
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')+ a! O: s  j. F: W3 K# ?
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')# d! s2 b1 U) h: I, X+ U# C
write('</div>')
+ `5 E- Q% }5 q' P) s8 @+ Y+ o- Y}8 H2 F6 I8 n" s& e' b. h1 ]! ~6 v
else if (document.layers){
' ~$ ~/ i3 V) m7 S. r) awrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
3 n' \  `# t4 U. j1 x* m, Gwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
; o+ a# d! k" T% Z, X: Ywrite('</ilayer>')
# W( D( f# v; U}
" e# K; x& {' L3 b2 Cdocument.write('</td></table>')6 O  b! D- w" |) @! P& r) K
}) S# {- M: f8 K# f' O* d* A3 t. O
}
: |' E# x; ~9 C</script>

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