// 创建对象部分
var wf = document.createElement("DIV"); wf.style.left = "-48px";
wf.style.top = "6px";
wf.style.width = pipe.offsetWidth + 96 + "px";
wf.className = "PipeWaterH"; pipe.start = function()
{
if(this.state == 'start')
return;
this.state = 'start';
wf.style.left = "-48px";
wf.style.display = '';
this.tmr = window.setInterval(function(){
wf.style.left = wf.offsetLeft + (pipe.way == "left" ? - 2 : 2) + "px";
if(wf.offsetLeft % 48 == 0)
{
wf.style.left = "-48px";
}
},200);
}样式部分.PipeWaterH
{
background-image:url(../img/PipeWaterH.gif);
background-repeat:repeat-x;
height:12px;
position:absolute;
}
运行后,div每次移动后都会重新加载,这个问题怎么解决?
IE的状态栏坐侧一直显示:正在下载图片http://localhost/img/PipeWaterH.gif,鼠标一直处于忙的状态
IE6.0的特色, 背景不进行缓存。
<style type="text/css">
.PipeWaterH
{
background-image:url('http://album.hi.csdn.net/app_uploads/wtcsy/20090605/140833261.p.gif');
position:absolute;
height:100px;
width:100px;
border:1px solid #000000;
}</style>
<body>
<div id='ss' class="PipeWaterH"> </div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input value="anaaa" type="button" onclick="an()" />
<script>
document.all&&document.execCommand("BackgroundImageCache", false, true); //就加这个
var i =1;
function an(){
setInterval(function(){i++;document.getElementById('ss').style.left=i;},10)
}
</script>
</body>
我之前虽然解决了,但是是在div里加了n个IMG对象才可以的
我回头再试一下这个