tdhock / animint

animated and interactive web graphics
146 stars 37 forks source link

do not load animints right away in Rmd #147

Open tdhock opened 8 years ago

tdhock commented 8 years ago

because sometimes there can be a lot of them, and that can freeze the browser momentarily.

instead, when the user scrolls down, check if the div is visible, then render the animint if it is.

this will be difficult to write a test for...

tdhock commented 8 years ago

maybe use http://www.w3schools.com/jsref/event_onscroll.asp or https://api.jquery.com/scroll/

cpsievert commented 8 years ago

This should solve the problems for rmds at least https://github.com/hafen/lazyrmd