0

I have a problem with HTML Widget: on HTML widget opened on i Pad, if I tap with two fingers the screen and I pinch in, the Widget quits and goes back to the page of the iBook. This is the default behavior.

But what if I want modify this behavior?

I tried these solutions:

document.addEventListener('gesturechange', function (e) {e.preventDefault();}, false);
document.addEventListener('gesturestart', function (e) {e.preventDefault();}, false);
document.addEventListener('gestureend', function (e) {e.preventDefault();}, false);
document.addEventListener('touchmove', function (e) {e.preventDefault();}, false);

in head of main HTML file.

I've also tried, in my code,

 $(document).bind("gesturestart", function(e) { 
    e.preventDefault()
    }
    )

but it doesn't work.

I would to close my HTML widget only tapping the "X" upper left and not with two fingers gesture.

I saw working examples of this in i Bookstore but of course I have not the code.

Any hint?

Aleksander Blomskøld
  • 18,374
  • 9
  • 76
  • 82

1 Answers1

1

Ok, I found it!

This is the correct code:

<script type="text/javascript"> 
document.addEventListener('touchmove', function (e) {e.preventDefault();}, false);
document.addEventListener('touchstart', function (e) {e.preventDefault();}, false);
document.addEventListener('touchend', function (e) {e.preventDefault();}, false);
</script>

Thanks to Thomas_101 of Apple Support Communities! https://discussions.apple.com/message/20631617#20631617