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

|
网页之跑马灯文字特效
//修改宽度) Y; F0 r6 ~+ @9 P4 n. U. j2 O- R
var marqueewidth=300. K, i' p6 M) U6 A( x
//高度
: {; ~9 l% t- e" I/ q8 fvar marqueeheight=25
* \; k& K9 Q; D% K//速度(1-10)
, X6 N, u+ y2 E. `" Rvar marqueespeed=3 J1 ?& R& F& }- g3 c# c9 p, q
//背景颜色
% E# R S0 D9 l- m9 svar marqueebgcolor="#FFFFFF"
+ ?2 C" c5 v$ d7 B# n! l5 H//是否能暂停 (0=no. 1=yes)?
! ]- i9 m! c) ?& Ivar pauseit=1. w' F2 \" D8 s `: E) ~; y
, L' ]1 L0 M7 h, w" o9 E5 p//修改显示内容& d5 r$ V+ \ g9 _( ]
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>' K' u! N2 l( d# K
, U, d O2 V, p9 \( h: d9 a
0 B6 N6 d( f7 ~- v/ W9 _ H4 g# m////下面不需改变////////////
; J# v' D* S, @! |5 o& e
. l: q( ^2 P* Y$ G ?var copyspeed=marqueespeed
, ]7 P4 `3 Z+ k+ ~* z( s) p7 Zvar pausespeed=(pauseit==0)? copyspeed: 03 Y, f! H O4 G1 E# G! W
var iedom=document.all||document.getElementById' B& E* ^$ ^, F4 v
if (iedom)6 ]( d% q7 B! R
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')" L3 s0 F4 W+ }
var actualwidth=''5 H1 ?% r/ `5 _& @7 K& I5 @) R% E
var cross_marquee, ns_marquee8 T) W5 ]1 }, l
( j8 P+ U) a- {/ z7 f
function populate(){+ A( L" ? P. H) @
if (iedom){5 b& c% [( _# v1 v% _4 I: T& b
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
0 ~$ M9 l" k; o9 M, e4 D! W6 Tcross_marquee.style.left=marqueewidth+89 F( h8 R# M, l( p8 N
cross_marquee.innerHTML=marqueecontent
: q* ?# Q0 Y* xactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth, |' {' ?; C4 w' W9 c5 s6 T/ A
}1 ^ g) V! z4 `4 x8 g5 C( V2 h
else if (document.layers){# [& U$ r, l$ S" S ^8 n9 H
ns_marquee=document.ns_marquee.document.ns_marquee2# p- a0 N1 e& Q4 J+ l( O/ F
ns_marquee.left=marqueewidth+8
5 L! @% u1 q: r X: Xns_marquee.document.write(marqueecontent)
$ m O/ l% l9 s7 ~1 K4 }ns_marquee.document.close()$ @/ n: X0 I0 c' _2 Z9 h
actualwidth=ns_marquee.document.width
; \+ ?* u, H2 j# Q+ g$ \}
. q8 W0 `+ ^$ f1 `$ blefttime=setInterval("scrollmarquee()",20)- I; h5 G+ ?. L. H* F7 {
}
( M6 I% F1 e( V& Jwindow.onload=populate$ c9 S3 ^' C$ v/ g! A& Y* _
" w2 I; f6 {* l7 `4 i3 Efunction scrollmarquee(){
7 G- T& I2 B+ ?* |5 m4 d2 Aif (iedom){ [( x L4 ^) X, f7 v
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
) ~: H1 A* ^8 v p* s( Jcross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
( l) I# w3 d2 s3 \. M; X9 ~else
+ n9 c% N* }) ?& v4 `cross_marquee.style.left=marqueewidth+8/ D% b. ?& A) z2 M5 [) X {& `, r& ?
7 X+ a4 h& _$ R
}: e: C* |" B# `# y
else if (document.layers){. Q, l1 E1 |2 e7 Z9 G- D+ {
if (ns_marquee.left>(actualwidth*(-1)+8))* u( q; q4 U9 {* `- J5 y$ k) w
ns_marquee.left-=copyspeed6 a) D. V* Y2 T, x
else
4 k, n1 l) Q3 ?, k' i: J, H+ Yns_marquee.left=marqueewidth+8 U$ W( Q6 {8 c9 f$ w- ]% X b: j
}
' a+ d$ ]8 ?4 c9 x2 j6 Z}, F1 R- q- l( S# ?2 O6 C+ A! `( H; ~
- ?; m+ a( k2 G0 w, }* w& z9 aif (iedom||document.layers){
1 N; ~" [1 _7 P* _, `+ M1 j3 X' ewith (document){
' H' j5 Z8 h. z% e3 q Cdocument.write('<table border="0" cellspacing="0" cellpadding="0"><td>')8 x* K1 K/ m& M3 o4 w, R
if (iedom){% a& S4 Y8 W6 X5 _* Q
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ q- j, b2 a) X* D; t
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
) e4 a _. V1 H( ]) U+ @! Jwrite('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
6 H, a& [$ {) M! N2 \write('</div>')& L6 c) w: |) e; \) s
}
; s. M t: H: xelse if (document.layers){# t1 {7 X" [1 A8 d# i+ \$ }0 K
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
# G3 B% L9 N9 k6 |% vwrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
" A I; O4 n5 _4 h9 V' y Wwrite('</ilayer>')
# A j2 _7 Y' L2 O}2 c: Y+ b4 X- @ x- H
document.write('</td></table>')) _' [/ }4 [& k% w1 g
}
: ~/ F9 s# c7 R; T}- }, D/ D8 f( h6 a8 I" z9 g
</script> |
|