title: Backbone.Marionette onRender callback fires before view is rendered in browser?
body: <h2>The setting</h2>
  
  <p>I have Backbone.Marionette.ItemView which renders some content. When the content is rendered I'd like to apply a jQuery plugin which turns part of the view into a container with a scrollbar.</p>
  
  <p>The scrollbar is implemented completely in javascript and upon initialization it has to check the height of the scroll-container as well as that of the content inside the container.</p>
  
  <p>If the content is higher then the container, a scrollbar should be enabled.</p>
  
  <h2>The problem</h2>
  
  <p>While this all sounds simple, I've ran into a strange problem: </p>
  
  <p>If I initialize my scrollbar plugin directly in the onRender callback it seems to think the .scroll-container element has a height 0 and maxHeight of 0.</p>
  
  <p>If I wrap the initialization code inside a 0ms timeout though, everything works as it should, the .scroll-container element's height property is returned by jQuery correctly and the scrollbar plugin works great.</p>
  
  <h2>The code</h2>
  
  <pre><code>onRender: function() {
    var that = this;
    setTimeout(function() {
      that.onLayout();
      var $scrollContainer = that.$el.find('.scroll-container'), 
          scrollPane = new ScrollPane($scrollContainer, {
            maxHeightProperty: 'maxHeight',
            scrollUpButton: false,
            scrollDownButton: false
          });
    }, 0);
  },
  </code></pre>
  
  <h2>The question</h2>
  
  <p>I'm assuming the problem occurs because the browser didn't finish actually rendering the newly inserted html when the onRender callback is executed.</p>
  
  <p>Is this assumption correct? And if so, is my solution of using a 0ms timeout reliable under normal circumstances?</p>