网页之跑马灯文字特效
//修改宽度&n@ h"j'_q2U5Evar marqueewidth=300%^A9o4D*i%A\C K9r
//高度
var marqueeheight=25
//速度(1-10)
var marqueespeed=3t0w`4La/PF,D
//背景颜色
var marqueebgcolor="#FFFFFF"
//是否能暂停 (0=no. 1=yes)?DFUD}M$u SWS~
var pauseit=1!C*{#o^M'~#d
//修改显示内容
var marqueecontent='<nobr><font face="Arial" size=2><a href="http://www.jzzy.com/js.asp">欢迎光临七色风网页家园</a>--这里有从上千个网页特效中精选的300多个实用的特效,另外,为了网友更方便地学习,我们还改写和编写了部分的特效,并作了详细的说明和必要的使用提示!</font></nobr>'
////下面不需改变////////////r Y&Z(W)} lU&YB
R7i:F(\g
var copyspeed=marqueespeedk.gE_DI+x
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+marqueecontent+'</span>');|#N u3Pd"Ee6lv
var actualwidth=''
var cross_marquee, ns_marquee`2DH sUm%[bb6V1f
!y1P/t!X2dj1X!| I
function populate(){
if (iedom){3w#yu O jc
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee[y/Y2Ey x
cross_marquee.style.left=marqueewidth+8
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidthN| S-yO^-R~z'~
}
else if (document.layers){(p1Wk.z} @n'[~
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=marqueewidth+8
ns_marquee.document.write(marqueecontent)6?w:y:Iz dm%j
ns_marquee.document.close())~T,`3q%M gVW.K
actualwidth=ns_marquee.document.width
},vc*[ ?!WJg&g(c
lefttime=setInterval("scrollmarquee()",20)
}8}0QH.~b
window.onload=populate
ga-p'yZ;dsO
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed
else
cross_marquee.style.left=marqueewidth+8K0{:m)W8SU2A
}5P#rf\X#Zn
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))C_8H%q9Ta G
ns_marquee.left-=copyspeed3V&H$Bu#w7V
else
ns_marquee.left=marqueewidth+8
}+Z3aF2q f`iA,e8J
}0g]DJ5D5M5}\7YdA
;e1X5]|S3`C
if (iedom||document.layers){-h$G1GaOl u
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')6uj+c]5{?
if (iedom){ K5~H!w ~ ~}%x
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')lCD0|._.|9ed
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')4G7|!}k{4|1L
write('<div id="iemarquee" style="position:absolute;left:0;top:0"></div>')
write('</div>')"a+U#nYh W
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')eU/D#pR
write('</ilayer>')lsu*w9}]u
}H0V7_:|)E6U&t
document.write('</td></table>')[:`;oP UE]F
}#wHL+Ek7Mw9p
}]ya{'V{^b;f7]
</script>
页:
[1]