图片滚动,先全部显示然后在滚动 正常的情况下是打开页面内容从最右边一点点出来.而对于这个很长的marquee框来讲,页面一打开就是一大片空白,然后是内容从右边一点点出来,得很久才能让页面充实起来..而不是所有人都有耐心慢慢等你所有的内容都出来.网上有好像有相关js能先全部显示然后在滚动,但是却不能一直循环滚动 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <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=1var scroll_end = document.getElementById("scroll_end");var scroll_div = document.getElementById("scroll_div");scroll_end.innerHTML=scroll_begin.innerHTMLfunction Marquee(){if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)scroll_div.scrollLeft-=scroll_begin.offsetWidthelse{scroll_div.scrollLeft++}}var MyMar=setInterval(Marquee,speed)scroll_div.onmouseover=function() {clearInterval(MyMar)}scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}</SCRIPT> <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>这样实现图片循环滚动不会出现空隙! - -# jQuery 查询xml文件节点 JS中function eventInfo参数,求详细讲解,有例子更好 jquery ajax 为嘛php返回值都是错误的呢 javascript初学者,一段代码看不懂…… 节气 动态给text加一个span? 右侧QQ在线联系滑动无法正常运行,跟DOCTYPE有关 DWR给javascript变量赋值的问题 Frame问题急需解答,高手请进 2019.7.13 JS函数练习 ie6的onmousemove问题 一段代码
<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>
<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>
这样实现图片循环滚动不会出现空隙! - -#