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.

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() });

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.