var pics = new Array("temppics/1.jpg","temppics/2.jpg","temppics/3.jpg");
    var titles = new Array("英超 鲁尼贝巴进球 曼联21纽卡11连胜","强悍!牛人一把吉他搞定一个乐队","联盟杯 AC米兰22战平不莱梅惨遭淘汰");
    var names = new Array("曼联","牛人","AC米兰");
    var thisPic = 0;
    function rotate()
    {
        thisPic++;
        if(thisPic == pics.length)
        {
            thisPic = 0;
        }
        document.getElementById("SlideImg").src = pics[thisPic];
        document.getElementById("SlideImg").parentNode.href="player/videoplay.aspx?vname=" + titles[thisPic];
        setTimeout("rotate()", 2 * 1000);
    }
    function initSlide(){
        var link = document.getElementById("Top1");
//        link.childNodes[1].firstChild.nodeValue = titles[0];
//        link.childNodes[1].href= "player/videoplay.aspx?vname=" + titles[0]; 
//        link.childNodes[4].firstChild.nodeValue = "演讲者:" + names[0];
//        link.setAttribute("onmouseover","ChangeImg(this)")
//        
//        link = document.getElementById("Top2");
//        link.childNodes[1].firstChild.nodeValue = titles[1];
//        link.childNodes[1].href= "player/videoplay.aspx?vname=" + titles[1]; 
//        link.childNodes[4].firstChild.nodeValue = "演讲者:" + names[1];
//        link.setAttribute("onmouseover","ChangeImg(this)")
//        
//        link = document.getElementById("Top3");
//        link.childNodes[1].firstChild.nodeValue = titles[2];
//        link.childNodes[1].href= "player/videoplay.aspx?vname=" + titles[2]; 
//        link.childNodes[4].firstChild.nodeValue = "演讲者:" + names[2];
//        link.setAttribute("onmouseover","ChangeImg(this)")
        rotate();        
    }注释掉的那几行为什么在FF下可以用,在IE7下却不能用?没什么特别的啊

解决方案 »

  1.   

    得看你的HTML是怎么写的光看JS是不知道的
      

  2.   


                     <a href="#"><img alt="讲座信息" id="SlideImg" src="temppics/1.jpg"  class="slideimg" /></a>
                     <table >
                        <tr >
                            <td id="Top1" rowindex="0"  style="padding-bottom:5px; border-bottom:2px solid #DEDF8C;" onmouseover="ChangeImg(this)">
                                <a href="#" target="_blank">111111</a><br />
                                <span >name111111</span>
                            </td>
                        </tr>
                        <tr>
                            <td id="Top2" rowindex="1"  style="padding:5px 0; border-bottom:2px solid #DEDF8C;" onmouseover="ChangeImg(this)">
                                <a href="#" target="_blank">222222</a><br />
                                <span >name22222</span>
                            </td>
                        </tr>
                        <tr>
                            <td id="Top3" rowindex="2" style="padding-top:5px;" onmouseover="ChangeImg(this)">
                                <a href="#" target="_blank">3333</a><br />
                                <span >name333333</span>
                            </td>
                        </tr>                
                     </table>