我真的不知道什麼是與動畫, 其只是生命的問題,因爲我試圖檢查的作品以及所有其他效果:Javescript jQuery的動畫不工作
$(document).ready(function(){
$("button").click(function(){
$("#box1").animate({left: '250px'});
});
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<title>Title</title>
<style>
.box{
border: 2px solid black;
width:100px;
height: 100px;
display: inline-block;
padding: 20px;
margin: 5px;
}
p{
font-family: Arial;
color: aquamarine;
font-size: 30px;
}
</style>
</head>
<body>
<h1 id="he"><center>New website</center></h1>
<p id="pp">Hey what's up?</p>
<button id="butt">click here</button>
<div id="box1" class="box">box9</div>
</body>
</html>
你還沒有爲你的#box1定義任何'位置'屬性' – vivekkupadhyay