How can I have a div go from collapsed to expanded (and vice versa), but do so from right to left?
Most everything I see out there is always left to right.
How can I have a div go from collapsed to expanded (and vice versa), but do so from right to left?
Most everything I see out there is always left to right.
Another worth mentioning library is animate.css. It works great with jQuery, and you can do a lot of interesting animations simply by toggling CSS classs.
Like..
You can define first the width of the element as 0, floating right, and then on the event that you are about to show it.. it would be like
Simple as that.
An example of right to left animation without jQuery UI, just with jQuery (any version, see https://api.jquery.com/animate/).
If your
div
is absolutely positioned and you know the width, you can just use:Which will slide it off screen.
Alternatively, you could wrap it a container
div
Reference: https://api.jquery.com/animate/