正常的情况下是打开页面内容从最右边一点点出来.而对于这个很长的marquee框来讲,页面一打开就是一大片空白,然后是内容从右边一点点出来,得很久才能让页面充实起来..而不是所有人都有耐心慢慢等你所有的内容都出来.
网上有好像有相关js能先全部显示然后在滚动,但是却不能一直循环滚动

解决方案 »

  1.   


    <DIV id="scroll_div" 
    style="OVERFLOW: hidden;height:137px;WIDTH: 658px;white-space: nowrap; ">
        <div id="scroll_begin" style="display:inline;"><img src="image/1.jpg" width="200" height="137" border="0"><img src="image/2.jpg" width="200" height="137" border="0"><img src="image/3.jpg" width="200" height="137" border="0"><img src="image/4.jpg" width="200" height="137" border="0"><img src="image/5.jpg" width="200" height="137" border="0"><img src="image/6.jpg" width="200" height="137" border="0"><img src="image/7.jpg" width="200" height="137" border="0"><img src="image/8.jpg" width="200" height="137" border="0"></div>
        <div id="scroll_end" style="display:inline;">
        </div>
    </DIV>
    <SCRIPT>
    var speed=1
    var scroll_end = document.getElementById("scroll_end");
    var scroll_div = document.getElementById("scroll_div");
    scroll_end.innerHTML=scroll_begin.innerHTML
    function Marquee(){
    if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
    scroll_div.scrollLeft-=scroll_begin.offsetWidth
    else{
    scroll_div.scrollLeft++
    }
    }
    var MyMar=setInterval(Marquee,speed)
    scroll_div.onmouseover=function() {clearInterval(MyMar)}
    scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </SCRIPT>
      

  2.   

    <div id="light" class="white_content"> 
    <a href="javascript:void(0)" 
    onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'" 
    id="close">关闭 </a> <br> 
    部门名称: 
    <input type="text" name=ndeptname id="ndeptname" /> 
    <br> 
    部门人数: 
    <input type="text" name=ndeptcount id="ndeptcount" /> 
    <br> 
    <input type="button" value="提交" id="update_${dept.id }"> 
    <input type="reset" value="重置"> 
    </div> 
    <div id="fade" class="black_overlay"> </div>
    这样实现图片循环滚动不会出现空隙! - -#