javascript|網頁|旋轉
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" >
//修改body為載入就顯示效果
<img src="/UploadPic/2007-7/200777173153492.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" ><img src="/UploadPic/2007-7/200777173153492.jpg" width="120" height="120" name="image"></body></body></html>
[Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行]