我是要做字幕上下滚动的
<DIV align="center">
<table width=380 bgcolor=#f7f8f9 border=0 cellspacing=0 style="border:#cccccc 1px solid;"><tr><td><div id="icefable1" style="width:500;">
<TABLE cellSpacing=0 cellPadding=0 width=380 border=0><TBODY><TR>
<TD height=18>·<a href="http://www.91yjs.com">中研网欢迎您</a></TD>
<TD height=18>·<a href="http://www.91yjs.com">中研网--中国研究生人才服务第一品牌</a></TD>
</TR><TR>
<TD height=18>·<A href="http://www.91salon.com" target=_blank>中研社区</A></TD>
<TD height=18>·<A href="http://www.91salon.com" target=_blank>属于研究生自己的社区</A></TD>
</TR><TR>
<TD height=18>·<A href="http://www.91salon.com/bbs" target=_blank>ODSP</A></TD>
<TD height=18>·<A href="http://www.91yjs.com/bbs" target=_blank>研究生职业发展沙龙</A></TD>
</TR></TBODY></TABLE>
</div><div id="icefable2" style="position:absolute;z-index:1;visibility:hidden"></div></td></tr></table>
<script>
marqueesHeight=18;
stopscroll=false;
icefable1.scrollTop=0;with(icefable1){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
nmouseover=new Function("stopscroll=true");
nmouseout=new Function("stopscroll=false");
}preTop=0; currentTop=0; stoptime=0;function init_srolltext(){
icefable2.innerHTML="";
icefable2.innerHTML+=icefable1.innerHTML;
icefable1.innerHTML=icefable2.innerHTML+icefable2.innerHTML;
setInterval("scrollUp()",50);
}
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==19)
{
stoptime+=1;
currentTop-=1;
if(stoptime==50)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=icefable1.scrollTop;
icefable1.scrollTop+=1;
if(preTop==icefable1.scrollTop){
icefable1.scrollTop=icefable2.offsetHeight-marqueesHeight;
icefable1.scrollTop+=1;
}
}}
init_srolltext();
</script></DIV>
但是我用鼠标停在链接上时,还是会滚动
,怎么像别的网页那样,停在上面就不滚动
<DIV align="center">
<table width=380 bgcolor=#f7f8f9 border=0 cellspacing=0 style="border:#cccccc 1px solid;"><tr><td><div id="icefable1" style="width:500;">
<TABLE cellSpacing=0 cellPadding=0 width=380 border=0><TBODY><TR>
<TD height=18>·<a href="http://www.91yjs.com">中研网欢迎您</a></TD>
<TD height=18>·<a href="http://www.91yjs.com">中研网--中国研究生人才服务第一品牌</a></TD>
</TR><TR>
<TD height=18>·<A href="http://www.91salon.com" target=_blank>中研社区</A></TD>
<TD height=18>·<A href="http://www.91salon.com" target=_blank>属于研究生自己的社区</A></TD>
</TR><TR>
<TD height=18>·<A href="http://www.91salon.com/bbs" target=_blank>ODSP</A></TD>
<TD height=18>·<A href="http://www.91yjs.com/bbs" target=_blank>研究生职业发展沙龙</A></TD>
</TR></TBODY></TABLE>
</div><div id="icefable2" style="position:absolute;z-index:1;visibility:hidden"></div></td></tr></table>
<script>
marqueesHeight=18;
stopscroll=false;
icefable1.scrollTop=0;with(icefable1){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
nmouseover=new Function("stopscroll=true");
nmouseout=new Function("stopscroll=false");
}preTop=0; currentTop=0; stoptime=0;function init_srolltext(){
icefable2.innerHTML="";
icefable2.innerHTML+=icefable1.innerHTML;
icefable1.innerHTML=icefable2.innerHTML+icefable2.innerHTML;
setInterval("scrollUp()",50);
}
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==19)
{
stoptime+=1;
currentTop-=1;
if(stoptime==50)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=icefable1.scrollTop;
icefable1.scrollTop+=1;
if(preTop==icefable1.scrollTop){
icefable1.scrollTop=icefable2.offsetHeight-marqueesHeight;
icefable1.scrollTop+=1;
}
}}
init_srolltext();
</script></DIV>
但是我用鼠标停在链接上时,还是会滚动
,怎么像别的网页那样,停在上面就不滚动
onmouseover='this.stop()'
onmouseout='this.start()'
nmouseout=new Function("stopscroll=false"); nmouseout ---> mouseout
<div id=demo style="OVERFLOW: hidden; WIDTH: 760px; align: center">
<table cellspacing="0" cellpadding="0" align="center"
border="0">
<tr>
<td id="marquePic1" valign="top"> <table width="958" height="130" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> <table id="DataList2" cellspacing="0" border="0" style="height:80px;width:1000px;border- collapse:collapse;">
<tr>
<td> <a href='center.aspx?p_type=1'> <img id="DataList2__ctl0_Image4" src="images\s2.jpg" alt="" border="0" style="height:80px;width:120px;" /> </a> </td>
<td> <a href='center.aspx?p_type=2'> <img id="DataList2__ctl1_Image4" src="images\s3.jpg" alt="" border="0" style="height:80px;width:120px;" /> </a> </td>
<td> <a href='center.aspx?p_type=3'> <img id="DataList2__ctl2_Image4" src="images\s4.jpg" alt="" border="0" style="height:80px;width:120px;" /> </a> </td>
<td> <a href='center.aspx?p_type=4'> <img id="DataList2__ctl3_Image4" src="images\s5.jpg" alt="" border="0" style="height:80px;width:120px;" /> </a> </td>
<td> <a href='center.aspx?p_type=5'> <img id="DataList2__ctl4_Image4" src="images\s1.jpg" alt="" border="0" style="height:80px;width:120px;" /> </a> </td>
</tr>
</table>
</tr>
</table> </td>
<td id="marquePic2" valign="top"> </td>
</tr>
</table>
</div>
<script type=text/javascript>
var speed=30
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script> 参考这个一下
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");//这里事件名写错了,改下就行了
onmouseout=new Function("stopscroll=false");
}
<tr>
<td bgcolor="#F7F7F7">
<marquee behavior="loop" direction="up" height="100" onmouseout="start()" onmouseover="stop()" scrollamount="1" scrolldelay="3">
<p>· 热烈庆祝网站正式开通<br />
· 前88位顾客可享受本站的免费服务<br />
· 本站在进一步完善开发中,请您多多支持 </p>
</marquee></td>
</tr>
</table>
不知道我这个能不能满足你的要求,你可以试一下