|
  
- UID
- 133
- 帖子
- 51
- 精华
- 1
- 积分
- 186
- 金币
- 55
- 威望
- 2
- 贡献
- 0

|
网页之跑马灯文字特效
//修改宽度
; H: t/ m$ x% o* Svar marqueewidth=300
& G6 y2 p& a' w1 D1 @* n' C7 M//高度
2 P$ N' }& a8 e+ C# s: ^1 yvar marqueeheight=25
4 I( |* H+ \- d: {) G8 s//速度(1-10)
2 Q. @; f- ?- zvar marqueespeed=3. R9 P& q" m' {& _& Z/ a/ Q- ~
//背景颜色
& F4 C+ ~ t# F( m6 \0 g* [var marqueebgcolor="#FFFFFF"/ Z( ]! e( z$ K2 h
//是否能暂停 (0=no. 1=yes)?# n/ U9 C- p: x% }
var pauseit=1
7 Q- D9 e$ x: S& r$ ]4 u3 b! e( j# N. ~ b; ?6 s
//修改显示内容
8 F& c* i" s& M2 ^ y2 T' rvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
/ h7 `3 L" s0 ^$ w! b* X( x1 r- T- _
* z( Z9 {: V4 w6 _1 L- i////下面不需改变////////////
, h* w ?$ N: b+ i; b1 a8 m: M1 j# R( L
var copyspeed=marqueespeed
. N; T0 U' {7 ovar pausespeed=(pauseit==0)? copyspeed: 0( n; e0 f5 Q/ ~
var iedom=document.all||document.getElementById" `0 S6 G1 M) ]& x4 c) ]9 L/ r
if (iedom)1 I, ?. s9 ^, D8 t6 O
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
6 K" y8 {7 Z* i' Evar actualwidth=''1 h' h# o; [ R1 ]4 G0 Y! R6 r: d
var cross_marquee, ns_marquee
& F% y+ i g" d
% W' d0 h/ n0 t3 ]function populate(){
4 _/ @1 Q' G1 e, P: Pif (iedom){& j. D, ^0 S% e1 C6 F+ B
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
# d* \4 X/ l+ k$ R; y6 U( ~cross_marquee.style.left=marqueewidth+8
, [2 Y+ J2 E/ ^ m# u3 f: ^3 i& mcross_marquee.innerHTML=marqueecontent0 {- k. U3 o4 R$ `
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
) n3 w( i3 [& h8 {% K}9 y0 k, W- H6 v( Z
else if (document.layers){6 C5 O) ~- K3 [
ns_marquee=document.ns_marquee.document.ns_marquee2
" \5 q* V+ k1 G4 S. v) Cns_marquee.left=marqueewidth+8
3 L" O0 s6 w& x1 ]1 o5 X9 Zns_marquee.document.write(marqueecontent)
, f1 y% _, o2 h# _5 m6 S( Xns_marquee.document.close()
- \% R! M8 F2 w- ]$ M1 gactualwidth=ns_marquee.document.width
. o) n) D" w; L}
- D4 s3 M2 e1 y4 z* G0 c$ \lefttime=setInterval("scrollmarquee()",20)& D5 J( r/ c. c3 d+ u% l
}
; N" J- l( ~/ T4 z- Qwindow.onload=populate/ T' H7 v1 b! Z0 a
$ V7 i) n1 q" G/ h6 n; k: c
function scrollmarquee(){+ u! t3 Z! x4 O- H. V t% j
if (iedom){
; F& O- ?; c+ \0 s& W/ u+ eif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
0 \1 u& \7 U" M7 o# xcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
2 p$ I' z1 P/ N" lelse
4 I' e1 }( W X) m9 icross_marquee.style.left=marqueewidth+88 D/ J5 W8 ~- j4 Y8 h
& S7 n) s- K* m" D
}
. q7 J# \* X$ ^else if (document.layers){$ r" _2 h5 z$ w; h$ x8 s: f
if (ns_marquee.left>(actualwidth*(-1)+8))
" Z2 v3 ~' b) o G- f! f- Nns_marquee.left-=copyspeed
$ b" [7 ]8 s8 }' c. delse' p. S; v! W; Y5 {# y0 r& a5 ^; H
ns_marquee.left=marqueewidth+8
* s! t2 f) b2 [8 S, J+ |* F}6 q7 D! m+ q5 D' M" K
}
B/ c# ? p* ~/ B; j5 x1 I. }
% z" \) Y. ~/ H8 c; M* O( Iif (iedom||document.layers){
7 E, }- |6 Z; Q5 F4 ?$ B3 m5 u- Gwith (document){
$ o3 Y) [- f7 ydocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>'): K$ K# o# U% e' ?+ O9 e
if (iedom){
% P3 s8 B5 X! Swrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
7 L6 k" U# H$ a2 a, A5 ywrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')0 m! {3 C+ x Y% r o) i
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')- D0 z- g) I, n9 }& W+ K
write('</div>')
9 S& C* u8 g5 C, |( f}! l8 V! O; D5 B) |% Y" D' I, v
else if (document.layers){6 L& @6 N$ {' j6 a2 J( }
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>'). O" D' G# [, h# P- H# ]8 _2 L& T
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" H8 Z: w+ r( o! O' w' m# r5 U Zwrite('</ilayer>')
, b6 I t p9 S* V. o}
; {& l* \8 N( r0 O r) ], g6 Ndocument.write('</td></table>')0 J% C/ w9 d) H# y
}. C8 I% k' Y3 s; L
}! l+ ?% O6 G+ Q# M7 Z
</script> |
|