我在这里做错了什么。动画滑出导航,但无法滑回。
$(document).ready(function() {
$('.navLink').click(function(e){
var navCount=0;
if (navCount==0) {
$('.navigation').stop().animate({'marginLeft':'0px'}, 200);
$('#waitingPage').stop().animate({'marginLeft':'230px'}, 200);
var navCount=1;
}else if (navCount==1){
$('.navigation').stop().animate({'marginLeft':'-230px'}, 200);
$('#waitingPage').stop().animate({'marginLeft':'0px'}, 200);
var navCount=0;
};
});
});//END ready
答案 0 :(得分:1)
类似的东西:
$('.navLink').toggle(function(){
// animation code
}, function(){
// animation code
});