I have several pages that I update dynamically with AJAX. When I'm done with the update, I call
- $("#page").trigger('create');
After this happens, on one page in particular, I need to scroll to the bottom of the page. I've been using pageshow as the event to use to trigger it, but I have to bake into it a timeout (using setTimeout) of at least 500, and that seems to need to increase as the page gets bigger in order to ensure it scrolls after it's done rendering.
It also doesn't work if I use the scroll functions immediately after the trigger, as that seems to occur asynchronously. I'm using iScroll4.
What event can I use that will reliably give me the completion of the rendering job? Would it be pageinit?