Is there anything in jQuery that allows you to specify the speed of a show/hide effect (as opposed to its duration).
Thanks.
Is there anything in jQuery that allows you to specify the speed of a show/hide effect (as opposed to its duration).
Thanks.
You can do:
.hide("slow")
.hide("fast")
There is no real difference between speed and duration in this situation. If the duration is short, then it's fast (higher speed).
To build on Yi Jiangs comment, speed is a function of distance and duration, lets say you want it to expand at say 200px/s
to do that you need to use element height and basic calculus to figure out how long the animation should take, if your element is 300px high animation duration should be:
300/200 = 1.5 seconds
or 1500ms, now apply that to http://api.jquery.com/slideToggle/ and we have a winner.