Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created January 23, 2013 19:26
Show Gist options
  • Save themorgantown/4611891 to your computer and use it in GitHub Desktop.
Save themorgantown/4611891 to your computer and use it in GitHub Desktop.
<script type = "text/javascript">
// make sure the browser does not do any scrolling (avoids iOS6 timer bug)
document.ontouchmove = function(event) {
event.preventDefault();
}
function documentLoaded(hypeDocument, element, event) {
var documentName = hypeDocument.documentName();
var mainContainerID = "#" + documentName + "_hype_container";
var box5 = document.getElementById('box5');
// when swiping right show the previous scene
$(mainContainerID).swipeRight(function() {
hypeDocument.showPreviousScene(hypeDocument.kSceneTransitionPushLeftToRight);
});
// when long tapping on box5, go to next scene
$(box5).longTap(function() {
hypeDocument.showNextScene(hypeDocument.kSceneTransitionPushRightToLeft);
});
// when swiping left show the previous scene
$(mainContainerID).swipeLeft(function() {
hypeDocument.showNextScene(hypeDocument.kSceneTransitionPushRightToLeft);
});
}
window.HYPE_eventListeners = [{"type":"HypeDocumentLoad", "callback":documentLoaded}];
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment