probably beaten to death-disabling context menu

Discussion in 'Javascript' started by andrew, Feb 17, 2007.

  1. andrew

    andrew Guest

    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?
     
    andrew, Feb 17, 2007
    #1
    1. Advertising

  2. andrew

    Ian Collins Guest

    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.
     
    Ian Collins, Feb 17, 2007
    #2
    1. Advertising

  3. On Feb 16, 6:45 pm, Ian Collins <> wrote:
    > ... 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
     
    Isaac Schlueter, Feb 17, 2007
    #3
  4. andrew

    Ian Collins Guest

    Isaac Schlueter wrote:
    > On Feb 16, 6:45 pm, Ian Collins <> wrote:
    >
    >>... 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.
     
    Ian Collins, Feb 17, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pat eyler
    Replies:
    2
    Views:
    93
    Jim Weirich
    Aug 29, 2005
  2. Michel
    Replies:
    2
    Views:
    149
    Michel
    Aug 2, 2004
  3. asim malik
    Replies:
    1
    Views:
    237
    Martijn Lievaart
    Sep 13, 2009
  4. lcplben
    Replies:
    3
    Views:
    496
    Garrett Smith
    Oct 30, 2009
  5. FAQ server
    Replies:
    0
    Views:
    1,176
    FAQ server
    Feb 22, 2012
Loading...

Share This Page