我想使用悬停并通过动画使我的 div 变长
这有什么问题?更新:文档再次没有结果
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("div").hover(function(){
$(this).animate({ width: "200px" });
}, function() {
$(this).animate({ width: "100px" });
});
}
</script>
<style>
div.ex
{
width:20px;
padding:10px;
background-color:gray;
margin:0px;
}
</style>
</head>
<body>
<form>
<div class="ex"></div>
</form>
</body>
</html>