homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Disable touch events - JQuery
using phonegap for iOS development

5+ Year Member

Msg#: 4524082 posted 6:34 am on Dec 1, 2012 (gmt 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');


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved