关于animate()的问题
为什么animate()在用来左右移动效果 设置left属性是有用的 设置right属性就没用,这里只能通过left来控制吗?
为什么animate()在用来左右移动效果 设置left属性是有用的 设置right属性就没用,这里只能通过left来控制吗?
2015-08-10
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn1").click(function(){
$("p").animate({right:"50%"});
});
$(".btn2").click(function(){
$("p").animate({right:""});
});
});
</script>
</head>
<body>
<button class="btn1">Animate</button>
<button class="btn2">Reset</button>
<div style="position:relative">
<p style="background-color:yellow;width:100px;position:absolute;right:0px;">This is a paragraph.</p>
</div>
</body>
</html>
举报