javascript - How to trigger a delayed jQuery event? -
i'm writing workaround web form. given problem hitting submit pops out loading animation. content saved, form still shown, loading animation.
the idea trigger event, 2-3 seconds after submit click, reset form content , hide loading animation.
how suggest approach this?
thank you.
use callback functions in events chain them - way make sure action has completed, instead of trying run of them @ same time. if post code can more. there's .delay()
function, think callbacks more appropriate, because process event driven , not time driven. have more flexibility in case in process goes wrong, instead of statically resetting after click.
Comments
Post a Comment