Languages

Menu
Sites
Language
Disable copy/paste and zoom when pressing jQuery button

In jQuery, when pressing and holding a button (or any text for that matter) a box will appear with a zoom on the text and after releasing the button there appears also a menu with copy/paste options for the text.

What is the easiest way, with the least amount of coding, to stop this from happening and just have the button respond to click events?

Thank you for your help.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

7 Replies
konduri sai swathi
Hi, Try the below code:
$('').live("contextmenu",function(){
		return false;   
	});
konduri sai swathi
$('id of the button').live("contextmenu",function(){
		return false;   
	});
konduri sai swathi
Hi, If the above doesn't work then try this procedure . Go to config.xml, in "tizen" tab, under setting section disable context-menu option. Doing this will disable context menu but the zooming will persist.
Vandersteene
Thank you for the information. After disabling the context menu in config.xml the copy/paste options popup is indeed gone but the selection hooks around the selected text are still there. I also tried your other suggestion but for some reason I couldn't make it work.
Marco Buettner
create a config.js and bind it to your project
$(document).bind("mobileinit", function() {
    $.mobile.tizen.disableSelection(document);
    $.mobile.tizen.disableContextMenu(document);
});
Vandersteene
Could you please explain a little more about this? 1. What exactly should I put in the 'config.js' file? 2. Should I put the 'config.js' file in the 'js' folder of the project? 3. Should I put your code snippet in the 'init' function of the 'main.js' file? Thank you for your help.
Marco Buettner
Put the code above in your config.js. The location of the config.js isn't necessary, put its normal to save js file in the 'js' folder ;) After that you have only to bind the config.js AFTER the Tizen Framework and BEFORE you other script files.