返回列表 发帖

网页之跑马灯文字特效

//修改宽度( c7 h* L/ M6 I, W2 [
var marqueewidth=3009 P$ z2 _# x+ u) g. _6 n
//高度
. d/ s& f! ?' j# V0 }: Ovar marqueeheight=257 k  w% J# S, ]  H
//速度(1-10)# H7 S# C% Z7 g0 n
var marqueespeed=3+ z: F7 r! \& a, _( B
//背景颜色
4 V$ o2 r6 [" \' Hvar marqueebgcolor="#FFFFFF"
! v9 C, F9 [8 _! P5 {//是否能暂停 (0=no. 1=yes)?
0 c& w& I7 R! g* |# Z$ Uvar pauseit=1. i7 }: t0 O0 D3 C0 c
# `: i8 f) |. l/ I  z% X% }
//修改显示内容/ }/ H1 Z) h% _2 H- c5 N0 @, r
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
- _" {, C) ^; a  O8 S
# k/ B2 j, S! z5 y/ |4 K5 [# c, u/ D8 `4 v" ]8 x
////下面不需改变////////////
  v5 K2 [3 u2 F$ ~2 m* R5 {6 Y. W+ @1 `; i$ x7 u( T9 D
var copyspeed=marqueespeed
. w, l6 F. H! H+ I) Bvar pausespeed=(pauseit==0)? copyspeed: 0
' e5 Y3 b/ O( s# Zvar iedom=document.all||document.getElementById5 L/ K+ Y9 A; O! J
if (iedom)
( z# g) q% ?. adocument.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')
; `+ l) i; D/ I, Zvar actualwidth=''2 a# c8 e. _2 Z3 y
var cross_marquee, ns_marquee) @; V0 F: }) z5 h* c

4 M* F5 P# z' x) m& Gfunction populate(){
% c& o2 m2 N" B/ t- i% n0 zif (iedom){
6 V$ |9 j) L5 ], A0 \( Kcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee6 k0 s9 `0 T* \' O2 ?* M
cross_marquee.style.left=marqueewidth+8+ _0 Q+ e/ }6 E
cross_marquee.innerHTML=marqueecontent# i$ x/ u1 a# w
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
+ `- D: m% |# w+ F# ?* q}
/ t. \5 ^8 r& S2 N+ V; ^else if (document.layers){
4 ~9 L' {: b6 h! P& Z( Hns_marquee=document.ns_marquee.document.ns_marquee2
3 C( k0 z) O5 h. {" J1 ?ns_marquee.left=marqueewidth+8
, u+ P: l- k$ Z2 L3 `2 \. Cns_marquee.document.write(marqueecontent)
& ?% V2 s5 z0 a2 P5 xns_marquee.document.close()
2 |. G0 k# }! }7 D9 `; }4 oactualwidth=ns_marquee.document.width8 v) p$ |# B4 W+ [- {3 `
}
  l4 n9 F' R0 G: M, q  o; p  Mlefttime=setInterval("scrollmarquee()",20)0 {: _$ d' G; S, }1 a( [
}
0 ~- ^5 U* j9 a! f: Mwindow.onload=populate9 D; o, N+ ?7 L! z
: P* _8 X* a% H9 f  C
function scrollmarquee(){7 N8 W! F# K2 t! K# h, S
if (iedom){
: E6 A/ r3 Q4 _5 n. `2 |* \! pif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)); B9 ]0 r. F1 Y  O: u% n$ j+ I" T
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
+ q$ |- ]" g9 N. Belse
. `8 c) H& e* p* Kcross_marquee.style.left=marqueewidth+89 Y& c7 l! w- D3 ^

& ]& b- J, ^% y$ t/ i0 y}
( Q- E& J/ S% s* M7 E( V5 uelse if (document.layers){
9 l0 o( \( }9 b3 _  zif (ns_marquee.left>(actualwidth*(-1)+8))
) V: o$ M8 i. _4 ?ns_marquee.left-=copyspeed
1 @. L2 T( N, S: Z* {& @2 U% kelse
7 m" @/ q) I9 f( J  lns_marquee.left=marqueewidth+8* q1 z9 U1 Y6 ~# w
}5 Y' r5 N- C$ q9 v
}) h- T# d( p& e9 U- e# F
& W6 k; y- b2 H0 v- A. b. ?" }
if (iedom||document.layers){
( U$ {2 d- G) G4 ]) p# ]: Z6 R* rwith (document){
3 \" R2 F) d; p/ E- }0 A6 \document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
# [2 ~% j2 m7 e$ J3 k6 Zif (iedom){6 X8 p" e9 P; a) x
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
9 Y  O8 _3 C6 @7 J* Vwrite('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
) ]$ ~' O# \% B- q* e9 A) C0 |write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')1 a6 `4 B) s- B6 o; _0 O: F
write('</div>')2 W1 f: y  q8 q
}; k3 L2 S: c% v, n+ Q
else if (document.layers){8 g: Z1 {8 J7 a5 {
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
2 U) S6 u: a( L% l! B0 Twrite('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')5 \) V! i" Z, M8 {  x
write('</ilayer>')
. r* p  u4 ]. _4 p+ L% Z# u}* r+ K7 P4 u4 X: w% C
document.write('</td></table>')! q* @- [- [$ b9 h" f% h
}
0 M9 H7 @/ g! H7 C: y$ J9 c) f4 z}8 a( y* t( U0 Q
</script>

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