0

I need to display a grid with a lot of images but this caused problems on safari for ipad... my project is similar to Albumatic demo from famo.us (you have to be registered, https://famo.us/demos ), and i found this: http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/

How can I address this bad safari limitation with famo.us?

sampopes
  • 2,646
  • 1
  • 22
  • 34
Alessandro Annini
  • 1,531
  • 2
  • 17
  • 32
  • What did you end up doing to work around this issue? I'm also working on a similar app where I need to display tons of images (not all at once), so wondering. – eozzy Jun 23 '15 at 00:30
  • > On the demo containerView is used, this is a very bad load for the browser, so try to change it in standard View. > Also try to set the image as background: url('/cabin.png'); of the surface This is all referring to Famo.us 0.3.5 that is deprecated anyway. – Alessandro Annini Jun 23 '15 at 07:45

1 Answers1

0

So I have not tested this but I had an idea. Depending on what you are doing you could reused the <img> tags. If you using ImageSurface then you can add your default image and then add it. Then when it's off screen you can hide it and change the image it holds with setContent(imageUrl). Then just move it to the new location and reshow it.

I am not sure if that the best idea/option but it is what I would try first. I am doing something similar with svgs and normal surfaces in my game app.

EDIT: After doing a good bit of research this limitation has nothing to do with famo.us specifically. It seems that as of iOS 7 images have cause a number of sites to crash, including apple.com. The only work around I have found is the one you posted. Set the tags to something very small when you are done with them and try to keep the number of active images as low as possible.

Sivli
  • 196
  • 1
  • 9
  • i tried.. i even moved the image from src to the backgroudImage of the surface AND implemented the image replacement when out of the viewport: the problem remains... it seems to me more like a bad memory usage – Alessandro Annini Apr 29 '14 at 21:00
  • The [raw ImageSurface](https://raw.githubusercontent.com/Famous/surfaces/master/ImageSurface.js) code is strait forward. When are you hitting the limit? Are you displaying too many images up front? I am assuming you also tried the empty image trick you posted? – Sivli Apr 29 '14 at 21:37
  • just try the famous demo Albumatic on a ipad – Alessandro Annini Apr 29 '14 at 22:10
  • I am still on the waiting list and limited to the source code. – Sivli May 02 '14 at 18:08