获得本站免费赞助空间请点这里
返回列表 发帖

网页之跑马灯文字特效

//修改宽度
( U  K3 t4 L) Ovar marqueewidth=300+ g% g- ~6 o9 v
//高度
+ c/ r7 y8 t/ z5 j$ xvar marqueeheight=25
7 h8 ]! b- s5 v% X' J' K5 R//速度(1-10)
2 K- r/ k. w' g0 W$ i" Z/ ?2 vvar marqueespeed=3& H, Q3 }" ]& M6 e
//背景颜色( R8 ~" I, y( K( k) V# P
var marqueebgcolor="#FFFFFF"
* k4 Z3 N8 ^; s& i3 r- I//是否能暂停 (0=no. 1=yes)?6 y6 D  D/ K+ i  v: A4 }
var pauseit=1- W8 U' k  o1 |, O7 [
# c8 E% a! P' J8 X2 W4 s6 o! |
//修改显示内容
+ _. W; c/ ~- nvar marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
9 c8 P2 o6 a8 e3 T9 p% J. y% h

. P" ]8 J$ ^. q9 C6 w7 B" z////下面不需改变////////////
/ V8 z; C. M2 y3 O3 K% y
- ~% z2 x2 F& b0 ~  w: W8 E9 }var copyspeed=marqueespeed
- r" i  i$ w0 ~$ Gvar pausespeed=(pauseit==0)? copyspeed: 0
8 a% q4 q; r2 K/ ]. r" |/ i, Bvar iedom=document.all||document.getElementById
: ?" t: Z/ e2 n* S' H2 M$ S7 d7 O- @if (iedom)# S7 s% H2 U/ p# b: m# B
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')5 ]7 D' S. V8 P7 @
var actualwidth=''0 d# h7 S) Y' x3 d8 q4 C
var cross_marquee, ns_marquee
# c7 u6 f' g) s( B0 E5 P0 I  Z6 U- d& R2 v6 s7 x$ k  ?
function populate(){
5 }/ C5 o' K: Y4 x+ Y1 m5 Oif (iedom){
, y, Z0 p! c& q8 a2 ^6 kcross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
/ t( e% q0 R6 M% K7 P" Q7 dcross_marquee.style.left=marqueewidth+8
2 @# ^& r& ]  \3 q1 R/ K( X9 Y" P0 ucross_marquee.innerHTML=marqueecontent
4 N* q0 e% m5 v7 u) T. W% Zactualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth, F/ Y# j7 |' }. L, i
}
' A/ R- j( v+ }7 I, Nelse if (document.layers){& Z. p; X# f4 v2 n- f5 i
ns_marquee=document.ns_marquee.document.ns_marquee23 t% _4 i) z# F
ns_marquee.left=marqueewidth+8. F& ?1 V0 P! t* N" f
ns_marquee.document.write(marqueecontent)
0 u4 F8 l( `, Q; P5 v) h' rns_marquee.document.close()* x, s/ u0 ?4 b. U
actualwidth=ns_marquee.document.width
3 @# l- E: I/ n" L}" a! q2 T* _5 m8 G& ^( S; z7 l
lefttime=setInterval("scrollmarquee()",20)3 `  i; Y7 `% Q/ b
}
9 U& h7 U+ u4 g* u- Ewindow.onload=populate$ _! q3 N* M' R$ E' j5 ~  R) P: u

4 A. A3 n4 l% F& B* @) H6 t. H+ h; xfunction scrollmarquee(){
0 f! ^/ |0 w; k$ |if (iedom){
- c" H+ z6 W$ _! ?1 F6 rif (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
' ?8 y1 g. |7 L% K# p* ~cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
3 \' H; C4 j; ]+ r1 ^else5 C0 {6 G! h* |8 [2 t$ a' a, u
cross_marquee.style.left=marqueewidth+8, f! V% w9 U) S5 \
0 ]* Y; W8 |+ ^; q; H  {  k
}5 O6 m0 l( c# `4 W6 L0 J
else if (document.layers){
+ q9 Z! ~8 `2 {. Iif (ns_marquee.left>(actualwidth*(-1)+8))
: d) K8 g8 ^( Y' L8 e' l, Bns_marquee.left-=copyspeed( \) N3 W) L2 Y* S7 q0 @7 p
else- d# I, u# \' {) _+ o* M
ns_marquee.left=marqueewidth+8
% T/ }2 U. K4 U0 e2 K}
! H. h3 i% F3 H3 I) w}% `! I$ T% m. M+ N4 W

$ |$ r% @: o7 M, `; c5 |& Oif (iedom||document.layers){8 G4 s7 j; _) ?" }: B" a
with (document){! u- m! U) F( {
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
! T* }, u8 V0 X  H! rif (iedom){
8 o) u! q7 k# v" Owrite('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')$ b. l/ l: p* G5 K7 Z. d
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')0 v1 W9 t* J5 H. [- `) f, p  P) B
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
2 I. _4 k. i& Dwrite('</div>')
- B( V; l$ ]) f# R}
- T5 j5 E: _# V5 O8 Q- Velse if (document.layers){) O, z5 P" b0 S% b* a$ a. x# E& z4 ^. \) \
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')( c1 t4 D. K5 |5 J! [1 o
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'), w. g' A; l) a/ H( ~, }# v
write('</ilayer>')
1 y! p$ b9 ?% n: E$ C' h/ ?}+ W9 s0 N/ j' H" T- f' U
document.write('</td></table>')7 z/ Q/ c* L; P3 b! G
}
9 ~5 G8 H6 J. T0 i}
6 O" j7 _0 |/ O& h9 c% s3 @, i8 \</script>

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