您的位置:首页 > Web前端 > JQuery

【Jquery】jquery动画效果animate

2013-05-26 20:50 387 查看
渐渐的拉长:

<div class="close-sidebar"><a href="#">关闭侧边栏</a></div>
<div class="show-sidebar" style="display:none;"><a href="#">显示侧边栏</a></div>

<script src="js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function () {

jQuery(document).ready(function($) {
$('.close-sidebar').click(function() {
$('.close-sidebar,.sidebar').hide();
$('.show-sidebar').show();
$('#shop_content').animate({
width: "66%"
},
1000);
});
$('.show-sidebar').click(function() {
$('.show-sidebar').hide();
$('.close-sidebar,.sidebar').show();
$('#shop_content').animate({
width:"40%"
},
1000);
});
});
});

</script>







其中#shop_content为你的html中的某个div的id,然后你就随便发挥吧,各种属性,神马marginLeft,marginTop,随便玩,自己搜下animate的api
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: