Pregunta

I have a setup where my scrollable container takes the full width and height of the viewport. I use iScroll to scroll the content over a background image. Works fine so far and I didn't find a better solution to have a fixed background image (any ideas would be awesome :) ). The problem is, that I can't zoom into the page anymore, cause iScroll disables it for the scrollable container, which is in this case the whole screen. Is there a way to get the native zoom feature back? I would also take a "desperate" solution which modifies the iScroll library or even another library for scrolling.

¿Fue útil?

Solución 2

So I've found a pretty nice solution, which is built into iOS5:

overflow: scroll;
-webkit-overflow-scrolling: touch;

That did the trick for my case. No need for an extra scrolling library and it has the same features as before (momentum scrolling, resizing and so on).

Otros consejos

For most mobile you won't be able to get the native zoom since iScroll overrides the touchstart and touchmove events. You can however have the simulated version of it by turning on the zoom option.

From the documentation :

var myScroll = new iScroll('wrapper', { zoom: true });
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top