Page 1 of 1

loading images only when shown on screen?

Posted: Fri Sep 20, 2013 10:55 pm
by Roger6240907

I execute a JSON request that returns a series of image urls. I want to load only the images that are currently in view so that it minimize the time and data download. I am looking for something like an event 'image show' as triggerable event of a image component. When the image is shown than execute the JS to load the url. Is this possible?

Thanks
Roger


loading images only when shown on screen?

Posted: Sat Sep 21, 2013 1:04 am
by Illya Stepanov

Hi Roger -- I'm not sure I understand the question.. in this part:

[quote:]
I want to load only the images that are currently in view ...
[/quote]


loading images only when shown on screen?

Posted: Sat Sep 21, 2013 1:42 am
by Roger6240907

Think about a JSON request returning 100 images. Let's say I can only fit 10 in the current view. Until the user scrolls down the other 90 are not shown. Is it possible to wait to load the other 90 until the user scroll down on the current page?


loading images only when shown on screen?

Posted: Sat Sep 21, 2013 3:12 am
by maxkatz

You can build such app... your app simply runs in the browser (http://docs.appery.io/getting-started) so you can add any features you want with JavaScript.


loading images only when shown on screen?

Posted: Sun Sep 22, 2013 3:45 am
by Roger6240907

Do you know the event to listen for when components come into view? it seems I cannot find it in Appery.


loading images only when shown on screen?

Posted: Sun Sep 22, 2013 2:54 pm
by maxkatz

All events that you see are browser or PhoneGap events. There are no Appery.io events. If you are asking when the page is loaded, you can use 'page load' event.