probably beaten to death-disabling context menu

A

andrew

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?
 
I

Ian Collins

andrew said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top