Open sadtaco opened 8 years ago
"sound like" differs from "is".
You can't use $.fn.transition()
as drop-in replacement for $.fn.animate()
. It was not a design goal of this project, as far as I know.
True for .stop()
but you can stop transition easily with saving transitioning property in at-the-moment state and, in same time setting $(element).css({ transition: 'all 0ms' })
which cuts off transition immediately.
You're absolutely right for not being able to use this lib for scrollTop
- scrollTop
is document property and not node style value.
options handling is also different
while it is the syntax for .transition you can't .animate({ x: 0, duration: 500 }) but you have to provide a second object as an argument
not sure why this is different in the first place
You can try https://github.com/baijunjie/jquery.animate
The details of it make it sound like a drop in replacement for .animate() but there are a number of issues I found that make it not.
with .animate() if you call .stop(true) it will drop all current animations on the element.
scrollTop: and some other properties also aren't valid for .transition()