JS的兼容问题

hk207 2010-06-29 03:39:21

<table width="216" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div id="makewing">
<table width="216" height="157" border="0" align="center" cellpadding="0" cellspacing="0"
class="pdtd">
<tr>
<td align="center">
<img height="96" alt="" src="/images/photo/3.jpg"
width="76" border="0" />
</td>
<td rowspan="2">
<p>xxxxxxxxxxxxxxxxxxxxxxxxxxx…<a href="/List.aspx"
class="red">更多 >></a></p>
</td>
</tr>
<tr>
<td align="center">
<strong>xxxx</strong></td>
</tr>
</table>
<table width="216" height="157" border="0" align="center" cellpadding="0" cellspacing="0"
class="pdtd">
<tr>
<td align="center">
<img height="96" alt="" src="/images/photo/1.jpg"
width="76" border="0" />
</td>
<td rowspan="2">
<p>xxxxxxxxxxxxxxxxxxxxxxxxxxx。<a href="/List.aspx"
class="red">更多 >></a></p>
</td>
</tr>
<tr>
<td align="center">
<strong>xxx</strong></td>
</tr>
</table>
<table width="216" height="157" border="0" align="center" cellpadding="0" cellspacing="0"
class="pdtd">
<tr>
<td align="center">
<img height="96" alt="" src="/images/photo/2.jpg"
width="76" border="0" />
</td>
<td rowspan="2">
<p>xxxxxxxxxxxxxxxxxxxxxxxxxxx…<a href="/List.aspx"
class="red">更多 >></a></p>
</td>
</tr>
<tr>
<td align="center">
<strong>xxxx</strong></td>
</tr>
</table>
</div>
</td>
</tr>
</table>


<script type="text/javascript" language="javascript">
marqueesHeight=157;
stopscroll=false;
with(makewing){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=marqueesHeight; stoptime=0;
makewing.innerHTML+=makewing.innerHTML;
function init_srolltext(){
makewing.scrollTop=0;
setInterval("scrollUp()",1);
}init_srolltext();

function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==marqueesHeight+1)
{
stoptime+=1;
currentTop-=1;
if(stoptime==1080)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=makewing.scrollTop;
makewing.scrollTop+=1;
if(preTop==makewing.scrollTop){
makewing.scrollTop=marqueesHeight;
makewing.scrollTop+=1;

}
}

}
init_srolltext();
</script>



以上JS为无缝间歇向上滚动。只在IE6没有问题。

哪位高手看一下,哪里有问题或者写的不标准导致不兼容?
...全文
148 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hk207 2010-07-06
  • 打赏
  • 举报
回复
顶起来………………
hk207 2010-06-30
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 mmm306306 的回复:]
建议使用个jquery插件
[/Quote]

难道就不能改为兼容的么?
leemiki 2010-06-30
  • 打赏
  • 举报
回复
用FireBug调试下不就知道哪出错了?不用框架处理兼容问题,往往要写两份,一份是处理IE,一份处理Firefox!
  • 打赏
  • 举报
回复
能,但不费事吗。时间就是……。兼容,jquery就替你干了。愿意就自己花时间研究了。
马老虎 2010-06-29
  • 打赏
  • 举报
回复
建议使用个jquery插件

87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧