470,863 Members | 1,099 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

probably beaten to death-disabling context menu

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
3 1307
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
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
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.

Similar topics

47 posts views Thread by Daniel Silva | last post: by
1 post views Thread by =?Utf-8?B?RGpub3J0aHl5?= | last post: by
1 post views Thread by James | last post: by
1 post views Thread by ashore | last post: by
6 posts views Thread by Rocketmagnet | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.