Code example: JQTouch page swipe
For anyone who can’t get this to work properly:
Specify your ‘class’ identifier for the action:
var jQT = $.jQTouch({
touchSelector: ‘.swipe’
});
AND specify what to do on swiping:
$(function(){
$(‘#main_page’).bind(“swipe”,function(event, info){
if (info.direction === ‘left’) {
jQT.goTo($(‘#page1′), ‘slide’);
}
});
$(‘#main_page’).bind(“swipe”,function(event, info){
if (info.direction === ‘right’) {
jQT.goTo($(‘#page2′), ‘slide’);
}
})
});
AND in your html name the div you want affected the relevant class (in this case it’s the div for my whole page):
<div id=”main_page” class=”swipe”>
