Skip to content

Instantly share code, notes, and snippets.

@higeorange
Created March 19, 2009 10:00
Show Gist options
  • Save higeorange/81691 to your computer and use it in GitHub Desktop.
Save higeorange/81691 to your computer and use it in GitHub Desktop.
// Ctrl + Right Click on Opera
(function($){
$.fn.contextmenu = function(callback) {
return this.each(function(){
var elm = $(this);
if ($.browser.opera) {
elm.bind('click', function(e){
e.preventDefault();
if (e.ctrlKey)
callback.apply(this);
})
} else {
elm.bind('contextmenu', function(e) {
e.preventDefault();
callback.apply(this);
});
}
})
}
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment