Created
January 23, 2013 19:26
-
-
Save themorgantown/4611891 to your computer and use it in GitHub Desktop.
Long Tap example for Tumult Hype: http://hype.desk.com/customer/portal/questions/724751-how-to-add-tap-and-hold-triggering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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