捌玖网络工作室's Archiver

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

网页之跑马灯文字特效

//修改宽度4W-Y4O8d0s'p7Etx k
var marqueewidth=300
b P0lsk%@5n Ys //高度
p(z-m{g:za(Dd var marqueeheight=25
ra@GT:L //速度(1-10)
C b~+H_ var marqueespeed=3
;P5u}*_Y@,H //背景颜色bxD$I^$YI
var marqueebgcolor="#FFFFFF"#LP"g)wL7w@
//是否能暂停 (0=no. 1=yes)?fhi#qm~l9d
var pauseit=1
;f^)Os.qK
[/Z2rhp_rE{ //修改显示内容8xW)D)]UFs
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>' ?w8q6N:^ l(T0?
YBm2y.wl v
X$Hj?3Y
////下面不需改变////////////
L'bt7j5K _
W(G5QC X pt xr var copyspeed=marqueespeed
|5J"U)n]H var pausespeed=(pauseit==0)? copyspeed: 0P4o@H { ]/YI
var iedom=document.all||document.getElementById
yvn n7_h&f)D@"f| if (iedom)
K u j o;VPhG9v k document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>')'m2sft*X}"}w3a_
var actualwidth=''
*Vn/T1O!z9x var cross_marquee, ns_marquee
^ bfiqw1iJp FHT#L2c3G
function populate(){
5_!j6N$} Z }z if (iedom){
b X@AY:fJUmd&xO&k cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
a StT V,_ cross_marquee.style.left=marqueewidth+8
LPB!M5v%A Rs(e9j._ cross_marquee.innerHTML=marqueecontent;u'GV+~gh
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
:dm&y w5VA1X-M9\T }
@~7Dj!y else if (document.layers){j$LXR S*B)z9}+c
ns_marquee=document.ns_marquee.document.ns_marquee2LAf#h2@#v
ns_marquee.left=marqueewidth+8h1OlZ F |7W8a
ns_marquee.document.write(marqueecontent)w"_8j!W*g"Y
ns_marquee.document.close()#p"Hb^N2a {
actualwidth=ns_marquee.document.width
0xB5h+u"N^ } } K@Aj lew
lefttime=setInterval("scrollmarquee()",20) V O1i*nFg
} D:vL%?r,M;V,M
window.onload=populate
|9p;\%Gl:q Tp;C8t
[)w5S!~q/Q ] function scrollmarquee(){
+Eq4NaJ$`Z*U if (iedom){T?#h8q?7I&a+M}Lp
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
6\)M4q2eV,V6c cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeediDi2c6~D U
elsewG-t my;q]
cross_marquee.style.left=marqueewidth+89DGL2AZ6z
j^6K[D8Z"?[
}!ZMK;h,y~i
else if (document.layers){
*lUgoX if (ns_marquee.left>(actualwidth*(-1)+8))
-i s5c x"@&h6S1k ns_marquee.left-=copyspeed/nQu;zK
elseh0p6qH t,E0NnW
ns_marquee.left=marqueewidth+8\M l1a2i
}Hg hef{
}!eeu\Dcx3M
m qK[0G;u"}J^ u
if (iedom||document.layers){
o$[v~7S*ht O_ with (document){
4hg){-tRE f"i document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')a%D7o O wD
if (iedom){
B/c]5` {H8E(w^ write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">'))E/~.unh;~'{gm
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')q5J1L#\9j dx
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
+TL3e ~/ESZ&B*^ write('</div>')0YT0R x G Yn C+LH
}
rLP Qc xqVZ else if (document.layers){
x}W@C:U:j write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')Z%qd0B5f mk
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')},\KE~+L|jH-f
write('</ilayer>')
H/J~s8G,r M r }
kV(N.U^q4m document.write('</td></table>')
J&~n;Q*n;JP }
k2I:I!s1c%V,L }*gP,]dW:r D \.f7@8G9U
</script>

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


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