我有这个网页上的鼠标悬停,元素旋转,并返回到mouseout原来的位置。使用Javascript的CSS3过渡
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
div
{
width:100px;
height:100px;
background:red;
transition:width 2s;
-moz-transition:width 2s; /* Firefox 4 */
-webkit-transition:width 2s; /* Safari and Chrome */
-o-transition:width 2s; /* Opera */
}
div:hover
{
width:300px;
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer.</p>
<div></div>
<p>Hover over the div element above, to see the transition effect.</p>
</body>
</html>
现在是否可以使用JavaScript触发此转换而不是使用defualt悬停功能。我尝试创建两个不同的类名,但即使我通过添加延迟和更改类来完成它也是可行的。无论如何,用Javascript做这样的转换?
你是冠军。谢谢bazillion次,非常感谢你! – Johnydep 2011-05-31 21:53:13