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
Tony
3,50710 gold badges32 silver badges46 bronze badges
1 Answer 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
dave
65.1k6 gold badges81 silver badges98 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Tony
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?
dave
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.lang-js