日期:2014-05-16  浏览次数:20445 次

淡入淡出效果js
<img id="img_bdzd" src="http://img.baidu.com/img/logo-zhidao.gif" />
<script>
var myI = window.setInterval(showImg,20)
var i = 100;
function showImg()
{
i--;
if(i>=0)
img_bdzd.style.filter = "Alpha(Opacity="+ i +")"
else if(i>=-100)
img_bdzd.style.filter = "Alpha(Opacity="+ -i +")"
else
window.clearInterval(myI);
}
</script>