soyjavi / QuoJS

Micro #JavaScript Library for Mobile Devices
MIT License
2.07k stars 236 forks source link

No native pinch to zoom #53

Closed scottwio closed 11 years ago

scottwio commented 11 years ago

Hi I might have missed something but it seem as though Quo completely overrides the native Pinch to zoom on websites on iOS. It would be really nice if there was away to still use QuoJS and keep the pinch to zoom a website the users are so familiar with.

soyjavi commented 11 years ago

Native pinch to zoom??? sorry but it's a meta

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />  

El martes, 26 de febrero de 2013 a las 11:41, scottmwilliams escribió:

Hi I might have missed something but it seem as though Quo completely overrides the native Pinch to zoom on websites on iOS. It would be really nice if there was away to still use QuoJS and keep the pinch to zoom a website the users are so familiar with.

— Reply to this email directly or view it on GitHub (https://github.com/soyjavi/QuoJS/issues/53).

scottwio commented 11 years ago

Sorry probably didn't explain myself correctly. I want pinch to zoom to work normally.

  1. Pinch to zoom on my site works perfectly
  2. Add QuoJS file, pinch to zoom then stops working (I'm guessing it's taking over some how)
  3. Remove QuoJS pinch to zoom works normally again

I want to be able to use QuoJS and still keep the normal pinch to zoom funtionality. My site currently has no viewport meta tags so should function normally.

soyjavi commented 11 years ago

QuoJS works with meta >>

hussainb commented 11 years ago

I too faced exactly the same problem as explained by scottwio, It doesn't matter if you have the meta viewport tag or not or if it has user-scalable yes or no, If Quojs is included, native pinch to zoom is disabled. Didn't get more time to find the reason.

Using jquery mobile as the framework. Page Setup: No Hardcoded Meta Viewport in beginning. (If viewport is hardcoded, Jqm modifies it and disables user-scalable) 1) Jquery 2) Jquery Mobile 3) QuoJs

4)$('', { // Fix to override jqm viewport hijack name: 'viewport', content: 'width=device-width, minimum-scale=1, maximum-scale=5, user-scalable=yes' }).appendTo('head');

Native zoom works without QuoJs.

Tried hammerjs in place of QuoJs, Same scenario, but it doesn't disable native zoom. What hammerjs does is that on pinchin it performs its user specified custom callback first then browser's native zoom takes place.

strider820 commented 10 years ago

Actually, this is a real bug. You have it watching on touchmove on the body, and if fingers === 2 the you call event.preventDefault. This kills native zoom on devices. Strangely, I can get it to zoom occasionally, though not reliably. But if I take out the preventDefault call, then it works fine. This seems like a bug to me.

strider820 commented 10 years ago

My comment is about the released version (2.3.6) Has this been fixed since then?