捌玖网络工作室's Archiver

zw2004 发表于 2008-1-21 20:53

网页之跑马灯文字特效

//修改宽度5I[Goc y
var marqueewidth=300:L#em.\v,X1]1d d X
//高度k#g([,Ar!TT f`1I
var marqueeheight=256qP?5]x4G
//速度(1-10)
PYX%E8F var marqueespeed=3
2H4WH7q0y4~1y //背景颜色
,hCS#\'`.P,M var marqueebgcolor="#FFFFFF"
/KhC y y q f*x:Ap3a //是否能暂停 (0=no. 1=yes)?
!A^[v!C2y-ki H#x var pauseit=1
@H:CR,O(p)[g F /J&Zl*~a$Fo
//修改显示内容
5P ~_6n k h var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
1T!w'z7l? uofL!yv }h-kg8{0`
%FD)Y8wYM
////下面不需改变////////////7s\&@M&Q-j8?\ n

`,~a p ZG:g5H I var copyspeed=marqueespeed8N o` vqu J7XJ
var pausespeed=(pauseit==0)? copyspeed: 0DF&{ V*\D%a6`4S
var iedom=document.all||document.getElementById*Rfc@ sB
if (iedom):T&f)akmf2HJ@i
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')t8J*GJ8~%|
var actualwidth=''2v:UGKdi%x
var cross_marquee, ns_marquee
/A R;Nbu8p 7QL9l;fK`jiB
function populate(){
E+`N Zlq.} S if (iedom){
'F;j*d;}%?j Zw s!| cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
[*Q"yaZ yH cross_marquee.style.left=marqueewidth+8
.D:G^j~I cross_marquee.innerHTML=marqueecontent
)F/M H6uB K!w actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidthQQ6_O?
}
4g8{q0?2GN*Gx] else if (document.layers){
2\ZAmVc ns_marquee=document.ns_marquee.document.ns_marquee2H/^_G&Z
ns_marquee.left=marqueewidth+8P:nyr5J,E)r.s h
ns_marquee.document.write(marqueecontent)k5[7`UO-F0@
ns_marquee.document.close()F1^Y:?h| v@&z
actualwidth=ns_marquee.document.width
{5T G-JmE }{L7i _+YGF2dG
lefttime=setInterval("scrollmarquee()",20)k!pBb4?7r
}(rb YY,w e0j
window.onload=populaterw Y#U5BW

QM-~4?Ttvj\ function scrollmarquee(){?ic"S*e8rX~}&Z
if (iedom){
dZ8o*xm q-fl if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))"Qz!C*O9Ld[
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed^8Y3~ @8HXZTg
else"lH7Nw}4n
cross_marquee.style.left=marqueewidth+8
4F0gC ^-tc `;_$z\:i
}m+N2v b'P
else if (document.layers){
7O)b4Y9Goc M^#W if (ns_marquee.left>(actualwidth*(-1)+8))
Q\Q!BOfj ns_marquee.left-=copyspeed
a9]i M*Af I else
+c `:j M p ns_marquee.left=marqueewidth+8]yQ Bh}Bb
},V\ju$Dp
}KO;U}I1h2D
9h8i }F~
if (iedom||document.layers){
.{Q6x-N%o9fB with (document){
T/b(A*] A document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')7D5K2xS6us?p1^
if (iedom){
;K&gK;O%L*i!` x2eJi write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
H;{:t W/IY write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')5q%F)Hs%^
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
#|J"UWEOh[5h write('</div>')C @MM_pFx:wA
} u7X ? lfU
else if (document.layers){
!Q[C}lVj write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
0F}1g7k$j].J t write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')k2SsX4p`4C
write('</ilayer>')
#^|6L*K5z0Fny }
U9zpRU1E document.write('</td></table>')
0uL:nq(Z { } `%q |L}5i;p
}*U3?d3S9y-?J1Ov
</script>

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.