I am using a custom scrollbar plugin (iScroll) that
needs to be programmatically refreshed after the DOM updates in order to deal with dynamic content (such as displaying a new passage). The Is there a callback or other hook I could use to call a function after the display code has updated, or do I need to override the definition for History.prototype.display?
(PassageDone and postrender both occur too early to be used for this purpose.)
Comments
PassageDone
?PassageDone
is called after the DOM has been updated, as opposed topostrender
tasks which are called before.From their documentation it seems like doing something like this: Or, if that doesn't work, this: Should work just fine from
PassageDone
. As noted, you may to lengthen the timeout duration, but I'd try without doing that first....I did try it in a timeout in postrender, but that failed too, and thanks to your reply I now know that this is because postrender is called before PassageDone.
Thanks for the help!
Just to recap, here's what I'm doing now: Here's what I hope to be able to do:
Via turns(): Via a session flag:
But I actually decided to tackle this differently. It seems to work so far, though I haven't tested it on every device yet. I just check for the content div to be resized using a timer interval, and when it is, do the refresh: