Rotation滤镜可以使图片产生旋转效果,注意必须是IE5.5及IE6.0才能看到!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body img{border:3 gold ridge}
</style>
//给图片加上边框的CS代码
<title>用Javascript使网页图片产生旋转效果</title>
<script language="javascript">
var i=0;
function playImg()
{
image.style.filter="progid:DXImageTransform.Microsoft.BasicImage( Rotation="+i+")";
i++;
if (i>4)
{i=1};
mytimeout=setTimeout("playImg()",1500);
}
</script>
//以上是使图片实现四个方向转换的代码
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="playImg()">
//修改body为加载就显示效果
<img src="/img/200406301.jpg" width="120" height="120" name="image">
</body>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body img{border:3 gold ridge}
</style>
<title>用Javascript使网页图片产生旋转效果</title>
<script language="javascript">
var i=0;
function playImg()
{
image.style.filter="progid:DXImageTransform.Microsoft.BasicImage( Rotation="+i+")";
i++;
if (i>4)
{i=1};
mytimeout=setTimeout("playImg()",1500);
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="playImg()">
<img src="/img/200406301.jpg" width="120" height="120" name="image">
</body>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]