我只是想創建一個圖像從一個按鈕點擊頁面的左側移動到右側。 我正在使用下面的一段代碼,但它不起作用。我是JQuery的新手。使用jquery點擊按鈕在html中移動圖像
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/
jquery.min.js"> </script>
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$("#but2").click(function() {
$("#vehi1").animate({ right:300px }, 500);
})
</script>
</head>
<body>
<div id="homel11">
<button id="but2"style="top:200px;left:30px;position:fixed">click me</button>
</div>
<div id="vehi" ><img id="vehi1" style="left:0px;position:relative;
top:540px;"src="vehi.png" />
</div>
</body>
</html>
有數以千計的這個問題重複的。 – Manoj