在IE7.0的环境下没有报错,在6.0中就频繁报错啊

jckzhang 2008-11-13 09:14:38

<style type="text/css">
.bigon{background:url(images/newsb-02.gif);color:#FFF; line-height:18px;}
.bigoff{background:url(images/newsb-03.gif);color:#000; line-height:18px;}
a.bla{color:#000; text-decoration:none}
a.bla:hover{color:#F00; text-decoration:underline}
</style>
<table width="312" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="312"><div id="fc" style="width:310px;height:240px;filter:progid:DXImageTransform.Microsoft.Fade ( duration=0.5,overlap=1.0 );">
<div style="display:block;"> <!-- 图1及链接 -->
<a href="http://oa.7wind.net" target="_blank"><img src="image/zwzx/p1.jpg" width="310" height="240" border="0"
onMouseOver="clearAuto();" onMouseOut="setAuto()" /></a></div>
<div style="display:none;"> <!-- 图2及链接 -->
<a href="http://oa.7wind.net" target="_blank"><img src="image/zwzx/p2.jpg" width="310" height="240" border="0"
onMouseOver="clearAuto();" onMouseOut="setAuto()" /></a></div>
<div style="display:none;"><!-- 图3及链接 -->
<a href="http://oa.7wind.net" target="_blank"><img src="image/zwzx/p3.jpg" width="310" height="240" border="0"
onMouseOver="clearAuto();" onMouseOut="setAuto()" /></a></div>
<div style="display:none;"><!-- 图4及链接 -->
<a href="http://oa.7wind.net" target="_blank"><img src="image/zwzx/p4.jpg" width="310" height="240" border="0"
onMouseOver="clearAuto();" onMouseOut="setAuto()" /></a></div>
<div style="display:none;"><!-- 图5及链接 -->
<a href="http://oa.7wind.net" target="_blank"><img src="image/zwzx/p5.jpg" width="310" height="240" border="0"
onMouseOver="clearAuto();" onMouseOut="setAuto()" /></a></div>
</div></td>
</tr>
<tr>
<td height="26" background="http://mat1.qq.com/news/logo/newsb-01.gif">
<table width="310" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="253" align="center" onmouseover="clearAuto();" onMouseOut="setAuto()">
<div id="con">
<div style="display:block;"> <!-- ★图1文字及链接 -->
<a href="http://oa.7wind.net" target="_blank" class="bla">1</a></div>
<div style="display:none;"><!-- ★图1文字及链接 -->
<a href="http://oa.7wind.net" target="_blank" class="bla">2</a></div>
<div style="display:none;"> <!-- ★图1文字及链接 -->
<a href="http://oa.7wind.net" target="_blank" class="bla">3</a></div>
<div style="display:none;"> <!-- ★图1文字及链接 -->
<a href="http://oa.7wind.net" target="_blank" class="bla">4</a></div>
<div style="display:none;"> <!-- ★图1文字及链接 -->
<a href="http://oa.7wind.net" target="_blank" class="bla">5</a></div>
</div> </td>
<td width="57">
<table border="0" align="center" cellpadding="0" cellspacing="5" class="lhn" id="num">
<tr>
<!-- ★图1按钮 -->
<td width="14" height="18" align="center" background="images/newsb-02.gif" class="bigon" onclick="Mea(0);" onmouseover="clearAuto();" onmouseout="setAuto()" style="cursor:pointer;">1</td>
<!-- ★图2按钮 -->
<td width="14" align="center" background="images/newsb-03.gif" class="bigoff" onclick="Mea(1);" onmouseover="clearAuto();" onmouseout="setAuto()" style="cursor:pointer;">2</td>
<!-- ★图3按钮 -->
<td width="14" align="center" background="images/newsb-03.gif" class="bigoff" onclick="Mea(2);" onmouseover="clearAuto();" onmouseout="setAuto()" style="cursor:pointer;">3</td>
<td width="14" align="center" background="images/newsb-03.gif" class="bigoff" onclick="Mea(3);" onmouseover="clearAuto();" onmouseout="setAuto()" style="cursor:pointer;">4</td>
<td width="14" align="center" background="images/newsb-03.gif" class="bigoff" onclick="Mea(4);" onmouseover="clearAuto();" onmouseout="setAuto()" style="cursor:pointer;">5</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script>
var n=0;
var showNum = document.getElementById("num");
function Mea(value){
n=value;
setBg(value);
plays(value);
cons(value);
}
function setBg(value){
for(var i=0;i<5;i++)
if(value==i){
showNum.getElementsByTagName("td")[i].className='bigon';
}
else{
showNum.getElementsByTagName("td")[i].className='bigoff';
}
}
function plays(value){
try
{
with (fc)
{
filters[0].Apply();
for(i=0;i<5;i++)i==value?children[i].style.display="block":children[i].style.display="none";
filters[0].play();
}
}
catch(e)
{
var divlist = document.getElementById("fc").getElementsByTagName("div");
for(i=0;i<5;i++)
{
i==value?divlist[i].style.display="block":divlist[i].style.display="none";
}
}
}
function cons(value){
try
{
with (con)
{
for(i=0;i<5;i++)i==value?children[i].style.display="block":children[i].style.display="none";
}
}
catch(e)
{
var divlist = document.getElementById("con").getElementsByTagName("div");
for(i=0;i<5;i++)
{
i==value?divlist[i].style.display="block":divlist[i].style.display="none";
}
}
}

function clearAuto(){clearInterval(autoStart)}
function setAuto(){autoStart=setInterval("auto(n)", 3000)}<!--图片转换速度,数字越大越慢-->
function auto(){
n++;
if(n>4)n=0;
Mea(n);
}
function sub(){
n--;
if(n<0)n=4;
Mea(n);
}
setAuto();
</script>

这段代码在VS的编译环境下,切换不到设计页面。
可是能在IE7.0环境下运行。可是到6.0下,就会频繁报错。
...全文
88 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
anyqu 2008-11-13
  • 打赏
  • 举报
回复
JS脚本的问题,有些脚本和CSS 在IE7和IE6里是不一样的!
jckzhang 2008-11-13
  • 打赏
  • 举报
回复
是放在aspx的文件代码中才会出错
stayalive 2008-11-13
  • 打赏
  • 举报
回复
难道我的不是ie6,没有报错……
微软骗我这么多年,一直说我的是ie6
qinhl99 2008-11-13
  • 打赏
  • 举报
回复
www.cnblogs.com/leochu2008/articles/1237481.html
jckzhang 2008-11-13
  • 打赏
  • 举报
回复
showNum.getElementsByTagName("td")[i].className='bigoff';
第一个错误图片是报这个错误
jckzhang 2008-11-13
  • 打赏
  • 举报
回复

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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