I want to animate div to slide to the right like the example below:
but instead of shifting the margin, I want to “squish” the width but it’s not working by changing the width % ( width: '60%' ) it squishes to the left instead..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not sure if this is exactly what you’re looking for but try:
Fiddle
Or give
right:0to#contentin the CSS, then you can animate thewidthand it will shrink from left to right without requiring margins. Same effect as the above but cleaner. FiddleAlso, jQuery has a built-in “toggle event” for alternating clicks so, if you’re toggling just the click event you can use:
Fiddle