Created
November 8, 2012 13:32
-
-
Save sukima/4038818 to your computer and use it in GitHub Desktop.
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
// * document is the JavaScript document object | |
// * bind adds an event listener to the document object | |
// * pageinit is the event that document object should listen for | |
// * the anonymous function is the callback that getsw executed when the | |
// document recieves the pageinit event. | |
$(document).bind("pageinit", function(){ | |
// Now the pageinit event was triggered | |
// again lets attach an event listener to the document element #listitem2 | |
// This time the event to listen for is the swipeleft event | |
// The convinience function swipeleft is the same a s bind("swipeleft",...) | |
$("#listitem2").swipeleft(function() { | |
// when the user swipes left it triggers this function and executes the | |
// process of changing the page with the changePage function. | |
$.mobile.changePage("home.html"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks sukima!