I did not know that. That worked great!
Klaus Hartl wrote: > > > juliandormon wrote: >> >> I'm adding html into a div using append. I want to update my custom >> scrollbar >> plugin which is in a parent div after the append has completed loading to >> accommodate the new height of the content in the child div. What's the >> proper way of doing a callback after append for a different div? >> >> I cannot simply chain this because it's a different div. >> >> This is what I have but the callback paramater does not seem to work for >> append - perhaps it's not a parameter at all? >> <div id="parentDiv" class="scrollBar" > >> <div id=" childDiv" class="appendedContentGoesHere"></div> >> </div> >> >> $("#childDiv").append('mygreatHTML',function(){$("#parentDiv").updateScrollBar()}) >> >> Much appreciated! > > You don't need a callback, such operations happen one after the other in > JavaScript: > > $("#childDiv").append('mygreatHTML'); > $("#parentDiv").updateScrollBar(); > > You could of course still make a chain: > > $("#childDiv").append('mygreatHTML').parent().updateScrollBar(); > > That frees you from having to use another hardcoded id... > > > > --Klaus > > -- View this message in context: http://www.nabble.com/Callback-after-append--tf4146489s15494.html#a11800185 Sent from the JQuery mailing list archive at Nabble.com.