日期:2014-05-16  浏览次数:20306 次

求解关于使用animate来控制隐藏,展开效果
现在我这边写了个右键菜单,简单的display不能满足用户的需求。然后我就用jquery的animate来控制动画效果,但是有个问题,怎么写才能让菜单从右下角那点,向左上动画显现出来?
左上往右下倒是很好写,但是右下往左上不知道怎么写。

------解决方案--------------------

<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function(){
$('#showDiv').click(function(){
$('#div1').animate({
width : '200px' ,
height : '200px'
});
});
});
</script>
</head>
<body>
<button id="showDiv">显示DIV</button>
<div id="div1" style="position:absolute;bottom:0px;right:0px;border:1px solid;height:0px;width:0px;">
dsfasfasdfasdf
</div>
</body>
</html>