The distinction between past, present, and future is only a stubbornly persistent illusion.

Albert Einstein

Recently I was working with a page that was using jScrollpane inside of a “lightbox” iframe created via fancybox. Or, it was trying to. The problem was that even though we had this code inside of the iframe page:

$(document).ready(function() {
  $("#my-scroll-pane").jScrollPane();
});

In firefox, the scroll pane never showed up, and clicking on links inside the page to call it again also produced no results.

Luckily, firebug exists and I was able to discover that the div we were attempting to turn into a scroll pane had a javascript-calculated width and height of 0. Debugging the actual jScrollpane.js file and following its path in calculating these values showed that when it was attempting to find the innerWidth/innerHeight of the div, it was getting the answer of 0, so that’s what it used.

Thankfully someone had a similar problem and had filed a bug here. Essentially the problem is, as Kevin Luck described, that while the iframe is loading it is not visible, and so jS Continue reading →