Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Disable touch events - JQuery

using phonegap for iOS development

6:34 am on Dec 1, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 10, 2009
posts: 13
votes: 0

Not sure if this is the right area but I am having the most annoying situation. Ok, here goes. I am using a javascript based sliding menu for a mobile app. The "slider" works just like Facebook mobile, where u can click the button to show the menu on the left and click it again to close the menu. As an alternative, if u touch the still visible part of the page when the menu is showing it will also close. And that's it.

Problem: Note that I'm using Phonegap for this app. When i run the iOS simulator in Xcode all works fine EXCEPT if u swipeleft, for example, the page will move. I want to disable the swipe event all together. I have tried preventDefault, return false etc. Nothing seems to work. Again, my only goal is to disable touch events because for this app, I simply don't need em. Please see the javascript code for the menu show/hide below.

Thanks is advance. All is appreciated.


Code Below....................................

$(function(){ var menuStatus;

// Show menu

if(menuStatus != true){

marginLeft: "170px",

}, 300, function(){menuStatus = true});
return false;
} else {

marginLeft: "0px",

}, 300, function(){menuStatus = false});
return false;


// Menu behaviour
$("#menu li a").click(function(){
var p = $(this).parent();
$("#menu li").removeClass('active');
} else {
$("#menu li").removeClass('active');

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members