<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>1</title>
<script src="../../try/jquery-2.1.3.js"></script>
<script>
$(function(){
$("#panel").click(
function(){
$(this).animate({left: "1000px"},3000)
.animate({right: "1000px"},3000);
})
})
</script>
<style>
#panel{
position: relative;
width: 100px;
height: 100px;
border: 1px solid #0050D0;
background: #96E555;
cursor: pointer;
}
</style>
</head>
<body>
<div id="panel"></div>
</body>
</html>
jquery设置向左浮动之后再设置向右运动无法实现
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
斯洛文尼亚旅游 2015-04-03 03:02关注left和right原本就冲突。。你要是想还原设置left为0就好了
$(function () { $("#panel").click( function () { $(this).animate({ left: "1000px" }, 3000) .animate({ left: "0px" }, 3000); }) })解决 无用评论 打赏 举报