By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,699 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,699 IT Pros & Developers. It's quick & easy.

probably beaten to death-disabling context menu

P: n/a
Been searching around and seems that most people say it's impossible
because people can steal your code or images a million different ways
but here's what I want to do:
I'm trying to make a javascript slideshow. I want the left click to
next slide but the right-click to go to the previous slide.
My code works. It does what I want. But every time I right click on
the div in addition to going to previous slide it also opens up the
context menu.
I am not trying to prevent people from stealing code or anything. Just
don't want them to have to be able to easily change slides without
navigating around or messing with the keyboard.
Does anyone know of a way?

Feb 17 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
andrew wrote:
Been searching around and seems that most people say it's impossible
because people can steal your code or images a million different ways
but here's what I want to do:
I'm trying to make a javascript slideshow. I want the left click to
next slide but the right-click to go to the previous slide.
My code works. It does what I want. But every time I right click on
the div in addition to going to previous slide it also opens up the
context menu.
I am not trying to prevent people from stealing code or anything. Just
don't want them to have to be able to easily change slides without
navigating around or messing with the keyboard.
Does anyone know of a way?
The code I use does the following:

if( event.preventDefault )
{
event.preventDefault();
}

event.returnValue = false;

return true;

Which stops the context menu from being displayed an IE and Mozilla.

--
Ian Collins.
Feb 17 '07 #2

P: n/a
On Feb 16, 6:45 pm, Ian Collins <ian-n...@hotmail.comwrote:
... stops the context menu from being displayed an IE and Mozilla.
Unless, of course, the user unchecked the box in Preferences Content
Advanced (Javascript) Disable or Change Context Menus.
--i

Feb 17 '07 #3

P: n/a
Isaac Schlueter wrote:
On Feb 16, 6:45 pm, Ian Collins <ian-n...@hotmail.comwrote:
>>... stops the context menu from being displayed an IE and Mozilla.


Unless, of course, the user unchecked the box in Preferences Content
>>Advanced (Javascript) Disable or Change Context Menus.

Or even Preferences Content Enable JavaScript....

--
Ian Collins.
Feb 17 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.