1

This is less of a code question and more of a library support question. (I know, I know... SO is for code debugging!)

I am using Hammer.js within a jQuery Mobile web app. I have written some gesture handling code that enables users to pinch-to-zoom and swipe-to-scroll just one <div> in my project, while maintaining user-scalable=no viewport. After days of writing and debugging, it's working for me. It works and I have tested in Safari and Chrome on iOS 7, and in Safari on iOS 6. It's working on iPad and iPhone.

That is, until I "Save to Home Screen". Once I do this, and I launch from the icon on my home screen, my swipe-to-scroll functionality is lost. Pinch-to-zoom is still working.

Any idea what might cause working code in Safari to break once launched from inside a "Home Screen" icon web app ?

See for yourself at http://omdapp.devstage.co/ (open in mobile browser, and then use "Add to Home Screen" and try when launched from home screen)

Things I've tried:

  1. Adding "?v=1" to the JS includes
  2. Changing JS filenames altogether
  3. Clearing Safari history/cookies/data
  4. Debug to make sure no JS errors thrown
  5. Remove and re-add the Home Screen icon

Note: I do not have Mac OS, so I cannot test using Web Inspector.

3
  • well I don't want to speak too soon, but I may have resolved things... it might have been a problem with .removeAttr() Commented Oct 1, 2013 at 22:02
  • Also homescreen and ajax seem to not mingle well, so also try checking for that
    – frequent
    Commented Oct 2, 2013 at 6:07
  • @frequent interesting! thanks for the tip – the hammer events are appended in a return ajax call... perhaps that is part of the problem :) Commented Oct 2, 2013 at 16:04

0