I use hammer.js [the jQuery plugin version] to provide simple touch gestures - in this case I use swipeleft and swiperight to navigate between pages. Everything works well except ...
On some pages, I have an <iframe> to display Youtube videos. When the gesture starts with an <iframe> , javascript does not start to load the next page, because the context is an <iframe> and not the rest of the page. If this gesture starts somewhere else on the page [even if it ends with <iframe> ], the next page loads properly.
What I want to have is gesture recognition anywhere in the window, not an iframe.
I have done quite a lot of googling, but I have not yet come up with a working solution.
Here is my Jammer Jammer code:
var hammertime = Hammer('html').on("swipeleft", function(event) { document.location = "http://www.example.com/"; });
And here is the standard YouTube <iframe> code:
<iframe width="100%" src="http://www.youtube.com/embed/Gh5XWWXHVQk?rel=0" frameborder="0" allowfullscreen></iframe>
I am also a little new to JS.
Any help you can give would be greatly appreciated.
Ryan
Ryans source share