[jQuery] disable div oncontextmenu?

2007-01-02 Thread xmrcivicboix
Hi guys, I wanted to know if it's possible to disable contextmenu from a given element: span for instance. IE7 doesn't seem to like it very well? begin: function(){ var selectors = $([EMAIL PROTECTED]); $.each(selectors, function(i) {

Re: [jQuery] disable div oncontextmenu?

2007-01-02 Thread xmrcivicboix
no luck. IE7 says this object does not support this method or property. wycats wrote: Try $([EMAIL PROTECTED]).contextmenu(function() { return false; }); -- Yehuda On 1/2/07, xmrcivicboix [EMAIL PROTECTED] wrote: Hi guys, I wanted to know if it's possible to disable contextmenu from

Re: [jQuery] disable div oncontextmenu?

2007-01-02 Thread John Resig
no luck. IE7 says this object does not support this method or property. I think he meant: $([EMAIL PROTECTED]).bind(contextmenu, function() { return false; }); There's no contextmenu event method, which is what causes the error that you saw. --John

Re: [jQuery] disable div oncontextmenu?

2007-01-02 Thread Yehuda Katz
Eh. Good point. You should probably be using .bind anyway, even for stuff like click, to keep your apps future-proof. -- Yehuda On 1/2/07, John Resig [EMAIL PROTECTED] wrote: no luck. IE7 says this object does not support this method or property. I think he meant: $([EMAIL

Re: [jQuery] disable div oncontextmenu?

2007-01-02 Thread xmrcivicboix
I found a solution: document.oncontextmenu = function(){return false;}; so when i right click it disable the contextmenu on the body: then when i bind click event i do: document.oncontextmenu = function(){return true;}; so when one is on the other is off. Works pretty well with IE's. wycats