0

Let's say i've a div with several html info and structures and when i convert it to a dialog with jquery $("#infodata).dialog(...); it takes several seconds to be showed.

So, it's there a way or method that can be implemented to know when jquery finished rendering the dialog?

P.D : there's no ajax request, the html is still there but with display:none.

Thanks.

asked Apr 13, 2013 at 15:40

1 Answer 1

1

You could chain triggering an event on to the end of it, then you get

$("#infodata).dialog(...).closest('body').trigger('dialogueLoaded');

$('body').on('dialogueLoaded', function() { doOtherStuff() });

answered Apr 13, 2013 at 15:49
Sign up to request clarification or add additional context in comments.

2 Comments

thanks for your answer but i wanted to show a preloading message when the dialog is rendering... i guess in your example that the trigger is when it finishes, isn't it?
Yeah, if you want to show a preloading message, you can do: showLoading(); $("#infodata).dialog(...).closest('body').trigger('dialogueLoaded'); $('body').on('dialogueLoaded', function() { hideLoading(); doOtherStuff(); }); Where showLoading shows your loading message however you want.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.