Reputation: 5916
I'm trying to achieve something that seems quite simple but I have hard time doing so.
How can I animate a div making its width 80% of original from left to right? I want to keep the right margin where it is and moving the left one toward right.
Thanks and have a nice day.
Upvotes: 0
Views: 237
Reputation: 5269
Set float: right
on your element. Then:
$("#animate").click(function(){
$(this).animate({ width: $(this).width() * .8 });
});
Upvotes: 3