0

I'm trying to build an app based on Cordova and a js swiper (idangero), but I have to load big background images (stored locally and up to 2048x2048 pixel).

The problem: If I load about 5+ images (1 image for each page) at the same time the app will crash because of the memory limit.

So I wrote a function to load only 3 images (one visible, 2 out of the view). This works, but the swipe animation stops for a few ms while the new images gets loaded.

Is there a way to load new images smooth (without the animation freeze) while swiping the pages? Maybe using ionic or so? Maybe using multiple static pages instead of a swiper?

Thanks!

Xairoo
  • 335
  • 1
  • 9
  • did you try preloading those images? – Mudasser Ajaz Sep 07 '15 at 20:36
  • 1
    see this how to preload images, then images will be smooth, http://stackoverflow.com/questions/3646036/javascript-preloading-images – Mudasser Ajaz Sep 07 '15 at 20:40
  • Thanks for your answer, but I have tried this already - I'll run out of memory because all images will load on the start. And If I try to load for example only 5 images at the start and add new images after/while a swipe I'll get this freeze problem again. – Xairoo Sep 07 '15 at 20:45
  • Question is why are you using such large images for a mobile screen use ? Using such large images will not give you benefit considering the size of mobile screen. – Mudasser Ajaz Sep 07 '15 at 20:47
  • I use them as background images for a stylish recipes app. – Xairoo Sep 07 '15 at 20:54
  • you tried preloading with js or css ? – Mudasser Ajaz Sep 07 '15 at 20:59
  • both! it's really strange, but as I know there is a "pop-in" on larger images. And I think it's not possible to preload all images because of the memory limit. – Xairoo Sep 07 '15 at 21:07

0 Answers0