I made a slideshow using the slide template at "HTML5Rocks!", and modified it to include some interactive google charts.
Unfortunately, initially the HTML5 slide template hides all slides but the current, two following slides, and two preceeding slides (this is in the css default for a slide: .slides > article { display : none; }
). My interactive figures are slides (i.e. article
s) containing iframe
s with google charts inside. Unfortunately, slides that are first rendered display:none
have some sort of bounding box issue with google charts: when the slide is finally un-hidden, the chart is compressed and does not have interactive effects.
I was able to work around this by starting the default slide (i.e. not simply the current slide and its neighbors, but all slides) with display:block
. Then, when you change slides, I actively hide the non-current and non-neighboring ones. Now all charts render properly, but at the start of the presentation, it shows the final slide (because all are drawn and it is drawn last!).
I wanted to polish this around by adding an event that, after everything is loaded (i.e. CPU-intensive AJAX calls within an iframe
are finished running), the non-current and non-neighboring slides are hidden.
To do this, I need to trigger a callback event after everything is loaded and the browser is ready (including AJAX calls within iframe
s):
I tried the following, but it triggers too early, before the AJAX callbacks in my iframe
s have finished:
jQuery(window).load( function() { /* some code to hide the non-current and non-neighboring slides */ } );
So the non-current and non-neighboring slides are hidden before the charts are drawn, and when those chart slides are un-hidden, they are warped and ruined. I don't believe I can trigger my event with the AJAX calls, because they there are multiple (from multiple slides) that I want to finish.
So that's the framing story. Here's what I want to know: Is there an event that triggers after everything is loaded and the browser is completely ready?
Thanks a lot for your help.