<!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条回答
- Go 旅城通票 2015-04-03 03:02关注
left和right原本就冲突。。你要是想还原设置left为0就好了
$(function () { $("#panel").click( function () { $(this).animate({ left: "1000px" }, 3000) .animate({ left: "0px" }, 3000); }) })
解决 无用评论 打赏 举报
悬赏问题
- ¥15 FPGA-SRIO初始化失败
- ¥15 MapReduce实现倒排索引失败
- ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
- ¥15 找一位技术过硬的游戏pj程序员
- ¥15 matlab生成电测深三层曲线模型代码
- ¥50 随机森林与房贷信用风险模型
- ¥50 buildozer打包kivy app失败
- ¥30 在vs2022里运行python代码
- ¥15 不同尺寸货物如何寻找合适的包装箱型谱
- ¥15 求解 yolo算法问题