Hi!
Would it be reasonable to add a per-animation-step callback to jQuery UI effects?
So that when you e.g. hide() something,
then, on each
hide animation step, the per-animation-step callback is invoked.
Background:
I want to redraw SVG arrows on each animation step, when e.g. something is slided/folded in/out. I've done this for the
Resizable interaction (there's a
resize event, triggered on each resize step). But for jQuery UI effects, there are no per-animation-step callbacks to hook into.
(The SVG arrows point to different parts of the Web page, whose positions change when animations run, so I redraw the SVG arrows.)
Other approaches?
Is there some other approach you can think of? I've tested using setInterval(...) to schedule a redraw of the SVG arrows e.g. each 50 ms, until the effect animation completes, but the arrows are redrawn either too frequently (CPU expensive) or too infrequently (jerky animations).
--- The best option (with no
step callback in jQuery UI) might be to copy and modify the relevant jQuery UI effects, to add a
step callback. But then I'd need to maintain that duplicated code.
Related:
These two forum threads seem to be related:
(Should I have posted this in the `development' forum?)
Kind regards, Kaj-Magnus