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

|
网页之跑马灯文字特效
//修改宽度
5 Y- V9 o1 O* c. y J5 X/ \+ `6 Evar marqueewidth=300
% J9 ~4 x6 t5 ~! w//高度$ U" x2 n' h% \7 {9 q& O% t, C2 {
var marqueeheight=25
4 O6 M+ S* t- G1 \" G3 t//速度(1-10)
/ R, h4 X0 M0 o7 Dvar marqueespeed=3
+ o8 ~8 e+ N9 l1 I//背景颜色
! V7 G+ _7 u; U2 [- Bvar marqueebgcolor="#FFFFFF"
' [" y; c5 L" W4 a6 l5 R//是否能暂停 (0=no. 1=yes)?3 R( Y. h7 n( C. x3 S* h
var pauseit=1, K$ T0 S" v9 _: f8 I) g; w
1 g: l- W7 O3 X" b//修改显示内容
0 ^/ o/ c" N9 ?2 n C6 cvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
+ \) k: a' P7 c, P9 y+ b0 e# X7 _9 ~9 p# I
+ C1 ]7 z, q, T* K: x
////下面不需改变////////////
: v2 K" x3 h5 J4 @) ^! q1 o9 \
$ T+ B+ a6 |6 a' Nvar copyspeed=marqueespeed) S5 k2 @* l6 b, P, `
var pausespeed=(pauseit==0)? copyspeed: 0
- x# b' ~" _- _! z6 H( u. Gvar iedom=document.all||document.getElementById# v+ F7 T2 B5 a, V8 ^) ]3 D# [
if (iedom)+ ~4 |' E- p2 o& u! P/ ^$ q
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')" C( O9 p( O! j
var actualwidth=''
9 e2 g. M4 G2 Xvar cross_marquee, ns_marquee
! n+ a7 c; y6 J
. {: l( S5 X2 X$ L* Vfunction populate(){/ P/ H- m: y+ V' B) \
if (iedom){% b6 g5 b1 u9 S: M8 T
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee1 c9 v$ @; d% I+ _) X$ K# S
cross_marquee.style.left=marqueewidth+8
% I# H$ R4 d @& l( M0 ]cross_marquee.innerHTML=marqueecontent8 ~& j: F/ y; g5 G: Q/ I4 x, m g
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth7 v& d* O; Q9 i4 j0 {
}+ D: r5 Y3 l' L2 t
else if (document.layers){' ]0 e1 K, a3 X; p1 i! ^" x
ns_marquee=document.ns_marquee.document.ns_marquee26 C Z* {3 h+ G9 [ x* ~0 C: a
ns_marquee.left=marqueewidth+85 a& u- L' i2 w. C
ns_marquee.document.write(marqueecontent). i2 r/ }6 T* W- A" R3 y7 E& Y( \6 [
ns_marquee.document.close()1 J2 k: s2 J' H0 K/ g
actualwidth=ns_marquee.document.width5 ?6 T0 T" {+ D( k. Q8 F
}3 Z! s8 n( H0 @" w" _3 t, p
lefttime=setInterval("scrollmarquee()",20)
! U. ~' p+ m4 v4 q& d5 \}. d% Y5 ?& ?: g' O3 e1 n( D
window.onload=populate
. A7 o& E) f7 ?, n2 j! r
$ Q0 b$ M( s' k: K- Q$ J" Cfunction scrollmarquee(){) H* s- {+ z0 I* V1 C, E9 k# ?/ I
if (iedom){
$ X5 y/ y& B0 e/ x: gif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))" B* Z5 S3 l7 K$ N; _( P5 g% j
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
6 x5 ^, E1 C* F2 P5 ~4 lelse/ a4 x: P+ F/ m4 G
cross_marquee.style.left=marqueewidth+8
( p& f2 s7 E: g% v; e
4 ~: _# o" r& U}, h& ^5 f" B# K+ S5 w
else if (document.layers){0 L' r: u' w; Q/ R, Z/ k: z, u( L
if (ns_marquee.left>(actualwidth*(-1)+8))4 U: z- O" l- }- I' [, G: A3 ]- {7 \
ns_marquee.left-=copyspeed
- T5 ]% Y8 K7 y2 Qelse T% B! H8 J, c& Y o% D
ns_marquee.left=marqueewidth+89 q9 |( Y8 x+ }, H
}
5 l/ P( ?: o( E}+ v$ _1 _8 V& P% b* j& ^2 A
$ x. m* A% @9 O; ~1 \9 B4 i* @/ Qif (iedom||document.layers){
( R. b o& ]+ k+ x% H- o' ]' rwith (document){* D2 ~ q$ I+ ~& `3 ?
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
+ Y- g* E4 b }5 K9 {3 r+ qif (iedom){4 ^; a* }7 l9 r! B
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
9 `4 z" f, l0 U2 y% p% i# rwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')) q' ]3 I6 y* ^7 e* R j3 [
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')& K$ I$ p7 t; k, {5 _1 h8 Y+ ^' p* B
write('</div>') A6 \+ a' D% c/ t
}
) ]; h+ \* g+ ^, S: C; Y6 t/ Q6 }( J4 velse if (document.layers){, J5 T2 I/ b% h2 l
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
( e6 E5 M$ b) @7 Z# U' V+ q8 }write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')7 O0 y# @6 b! g; M) W% ~, _
write('</ilayer>')
& {, w" m5 k3 M% {5 F# a2 }}
: J* o j) e. q1 t' C" k( u! O6 odocument.write('</td></table>')
, w3 b# g; O8 x8 W) C}6 v- `7 o0 n9 D/ n4 ]' ]
}. f) ~8 u, k. t( @ k
</script> |
|