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

|
网页之跑马灯文字特效
//修改宽度8 r: W( {9 {4 u: v1 Z, H
var marqueewidth=300. C g% _8 h3 q1 v% J! u8 C
//高度# H( r3 u0 `4 }2 P2 \
var marqueeheight=25
0 R: @+ _5 v/ h; p* _; t% o//速度(1-10), `: u! y6 p6 l# _; W* T3 c
var marqueespeed=3
: u. T5 \' C* ?7 r5 D; [' ?! z//背景颜色2 W# j7 ^$ f- ?% i
var marqueebgcolor="#FFFFFF"! R' `7 z8 N0 M+ V* h5 V
//是否能暂停 (0=no. 1=yes)?% o1 T: ?8 {% H3 I( h4 E
var pauseit=12 }8 } E j0 L+ S: u
6 Q0 H5 B& ~9 P+ Z; O; b$ ]- j+ h
//修改显示内容
4 }) M5 s7 ~7 ^7 Z* h( E" Z9 Kvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'* r9 P. ~( }5 }
- z" j5 X. H# _4 |* X7 L- x
) j, c1 `. I5 \. K/ o
////下面不需改变////////////
- r5 I# V* o! h# u9 v7 W8 b! b8 p# i% r8 @0 M0 O
var copyspeed=marqueespeed5 B# {2 k- J( j8 H
var pausespeed=(pauseit==0)? copyspeed: 0/ c/ d# _: E h( g6 O" X& l
var iedom=document.all||document.getElementById: \. a( f& a2 V* U9 U
if (iedom)
$ X8 e% b) {3 o% ^& I- Z3 D$ }# edocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')" U9 o! s$ U/ Y) j
var actualwidth=''; J1 m4 \/ x6 u& J/ N
var cross_marquee, ns_marquee
$ J" F/ t4 J) m/ J6 a+ Z2 J
- e# X" r! Q7 M, kfunction populate(){" A! f. B+ z+ |( a
if (iedom){
1 l3 F1 Z6 Y& _cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee( f4 c2 v" r5 L: n z' r
cross_marquee.style.left=marqueewidth+8
K4 B! k, q8 N) D& E/ Scross_marquee.innerHTML=marqueecontent) t- b) P' ?% e
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth" W* k: s1 s5 n; k2 w5 U! q
}8 X6 q6 |8 f3 ^ I
else if (document.layers){
; p- B" q! D* x; d9 O% ~$ V# q' Qns_marquee=document.ns_marquee.document.ns_marquee27 y- U5 s% c* l% R& U: F
ns_marquee.left=marqueewidth+8( F" `0 A1 ^, H+ m- y" ^ _8 F& A
ns_marquee.document.write(marqueecontent)
* }- A/ M- m! c& V+ W' ens_marquee.document.close()
( |2 a( Q: b8 [actualwidth=ns_marquee.document.width( v* @* g) z* J* q
}
% s" d" z5 k9 R- rlefttime=setInterval("scrollmarquee()",20)/ {9 K+ \9 C: m) z
}" N. {7 A+ c( `
window.onload=populate! o( y2 M8 T1 a
9 u0 p- L4 R# Z7 D5 K7 G9 y
function scrollmarquee(){
/ P& U0 `6 L9 j. I$ pif (iedom){3 }! p0 K& | u0 G' o0 e1 B
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))( _4 M0 s; _$ c/ G
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
- K, j. r) s ~ L+ m4 F( `else- i1 m0 N' {* W
cross_marquee.style.left=marqueewidth+8
! X% e% h, u, @4 y7 ^& e1 z/ E: V
: N. G/ G" @5 z! V# D7 K, I}
3 L% m) o2 p5 }; X, felse if (document.layers){" i4 G& ?& I4 ~- `! g
if (ns_marquee.left>(actualwidth*(-1)+8))
& I4 _& ~7 Z, S1 O; Bns_marquee.left-=copyspeed4 v( J; m+ x8 O# }. E, V
else
) z$ ^4 a$ L: ~' Yns_marquee.left=marqueewidth+8
@) P' Z( w6 q n! w9 j6 F}
( F9 s4 r6 H" ]8 w1 _}, `8 J, `8 A: H0 j
* |) s$ O6 V' r8 ?1 F
if (iedom||document.layers){& b' C: g, V7 d/ u/ I- }" C
with (document){
5 w& N7 v* a* \9 P9 G' Udocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')4 S7 l! P) z( v5 D2 X0 s. }; _ r
if (iedom){
8 Z8 W p$ U& E( p# `& x- }write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
, a* a3 T2 G* w3 q: X5 v. Mwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')9 I; r0 j5 N. |1 R
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+ r, p; K, |/ u) [write('</div>')3 M$ U4 o! y$ e; g
}; G* a. e0 H9 k; A: U
else if (document.layers){
( }9 \/ Q: i( W1 r! D+ _7 i5 Uwrite('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')0 K' L" a' A! @: o* j5 K& G
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
/ h" J a8 S) \/ p5 E! I1 e% `# H. fwrite('</ilayer>')/ o1 d, [3 D+ t4 ]0 @
}$ ]& n/ w* f. [! _* ^" `$ n9 Z
document.write('</td></table>')
. b4 h% H2 X0 J6 b" r+ V}& n4 n+ m0 d. c" l7 @
}/ i4 T3 J) ^) f# E# m/ |& z: M& s' g h
</script> |
|