HTML图片旋转
<html>
<head>
<title> </title>
<script type="text/javascript">
function rotateImage() {
imageToRotate = document.getElementById('imgRotate');
imageToRotate.style.filter= "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')";
window.setTimeout("rotate()",100);
}
var imageToRotate;
var degreeToRotate=0;
function rotate(){
var deg2radians = Math.PI * 2 / 360;
degreeToRotate++;
degreeToRotate=degreeToRotate%360;
rad = degreeToRotate * deg2radians ;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
imageToRotate.filters.item(0).M11 = costheta;
imageToRotate.filters.item(0).M12 = -sintheta;
imageToRotate.filters.item(0).M21 = sintheta;
imageToRotate.filters.item(0).M22 = costheta;
window.setTimeout("rotate()",100);
}
</script>
</head>
<body onload="rotateImage();">
<br />
<canvas id="canvas" width="800" height="600">
<img id="imgRotate" src="http://www.baidu.com/img/logo-yy.gif" />
</canvas>
</body>
</html>
不用JS则为
<img style="filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.7071,M12=-0.7071,M21=0.7071,M22=0.7071,sizingMethod='auto expand')"
id="imgRotate" src=" http://www.baidu.com/img/logo-yy.gif" />
相关文档:
Example:
1.<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2.<!--[if IE]> 所有的IE可识别 <![endif]-->
3.<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4.<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5.<!--[if gt IE 5.0]> IE ......
最近在使用ext嵌入html页面的过程中,遇到一个问题。我们页面都是用html制作的,用iframe的方式嵌入到ext的panel里。其中有一个页面是在按钮触发的时候加载进去的,但是重新刷新浏览器,页面仍然嵌入在panel中,并没有卸载掉,在页面上设置清空缓存也没有效果。
后来我发现,只有在浏览器地址里 ......
访问控件的主要对象是:document对象。分别对应当前文档所有的(子对象)个人观点。并且已经提供的几个主要方法来访问对象。
1. document.getElementById
2. document.getElementsByName
3 &n ......
百度了下 大体知道 如下区别:
id 代表唯一 ,在整个页面是唯一的,不能重复。
name 可以重复,整个页面的 name 可以都一样
用在JavaScript 中 时
document.getElementById("str") 返回的是 唯一的数据。
document.getElementsByName("str") 返回的是个数组。
还有什么区别?有待路人指证! ......
鼠标的多种样式...
<P><a href="help.htm" style="cursor:hand">手</a>
<a href="help.htm" style="cursor:text">文本</a>
<a href="help.htm" style="cursor:MOVE">四个方向的箭头</a>
<a href="help.htm" st ......