I'm using periodic_remote_call and it updates a div with pictures.
How Can I get these pictures to be preloaded?
I'm using periodic_remote_call and it updates a div with pictures.
How Can I get these pictures to be preloaded?
I do not know hwether you still need the information, but you can indeed make a dynamic piece of JavaScript containing the ids, which you can use for your preload. Your View would contain something like this (assuming that @photo_ids
is the Ruby array):
<script type="text/javascript">
var photo_ids = new Array(%< @photo_ids.join(", ") %>);
</script>
Now you can loop your photos_id
in JavaScript to preload the images.