$(".btn").click(function(){
if($($(this).parent().parent()).width() == "100%" ){
$(this).parent().parent().stop().animate({
top : 0,
left : 0,
width : "500px",
height : "300px",
})
}else{
$(this).parent().parent().stop().animate({
top : 0,
left : 0,
width : "100%",
height : "100%"
})
}
})
here is my code. i don't know why my first animation doesn't work. animate width to 100% works well, but the opposite(to 400px) does not.