JS+CSS滤镜页面图片切换问题
<script>vari=0;window.onload=functiontabpic(){varpicnum=document.getElementsByName("p...
<script>
var i=0;
window.onload = function tabpic()
{
var picnum = document.getElementsByName("pic");
if(i<picnum.length-1)
{
picnum[i].style.display="none";
picnum[i+1].style.display="block";
i++;
}
else
{
picnum[i].style.display="none";
i=0;
picnum[i].style.display="block";
}
picnum[i].filters[0].apply();
picnum[i].filters[0].play();
setTimeout("tabpic()",4000);
}
</script>
<style>
img{display:none; border:none; filter:progid:DXImageTransform.Microsoft.RevealTrans ( duration=0.5,transition=22 );}
</style>
<img src="pic (1).jpg" name="pic" />
<img src="pic (2).jpg" name="pic" />
<img src="pic (3).jpg" name="pic" />
<img src="pic (4).jpg" name="pic" />
<img src="pic (5).jpg" name="pic" />
----------------------------------------------------------------------------
代码如上,为什么所有图片到显示第二遍的时候就没有效果了? 展开
var i=0;
window.onload = function tabpic()
{
var picnum = document.getElementsByName("pic");
if(i<picnum.length-1)
{
picnum[i].style.display="none";
picnum[i+1].style.display="block";
i++;
}
else
{
picnum[i].style.display="none";
i=0;
picnum[i].style.display="block";
}
picnum[i].filters[0].apply();
picnum[i].filters[0].play();
setTimeout("tabpic()",4000);
}
</script>
<style>
img{display:none; border:none; filter:progid:DXImageTransform.Microsoft.RevealTrans ( duration=0.5,transition=22 );}
</style>
<img src="pic (1).jpg" name="pic" />
<img src="pic (2).jpg" name="pic" />
<img src="pic (3).jpg" name="pic" />
<img src="pic (4).jpg" name="pic" />
<img src="pic (5).jpg" name="pic" />
----------------------------------------------------------------------------
代码如上,为什么所有图片到显示第二遍的时候就没有效果了? 展开
1个回答
2011-03-13
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询