<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片旋转cwwlgua</title>

<script language="javascript"> 
var isIE = (document.uniqueID)?1:0;  
var i=1; 
function rotate(image) 

var object = image.parentNode; 
if(isIE){ 
image.style.filter="progid:dXImagetransform.Microsoft.basicImage(rotation="+i+")"; 
i++;    
       if(i>4) {i=1}; 

else{ 
try{ 
var canvas = document.createElement('canvas'); 
if(canvas.getContext("2d")) { 
object.replaceChild(canvas,image); 
var context = canvas.getContext("2d"); 
context.translate(176, 0);  
context.rotate(Math.PI*0.5); 
context.drawImage(image,0,0); 

}catch(e){} 


</script>
</head>

<body>
<img id="myimg"src="6628_P_1251875354591.jpg" />
<input type="button" value="rotate" onclick="rotate(document.getElementById('myimg'))" />
</body>
</html>
更多精彩阅读来自:http://www.shyunlin.cn