Right Click Menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MisterG

    Right Click Menu

    Using the following code I am able to open a new window when a user right
    clicks an object in my document.

    if (window.event.b utton == 2) {
    Win1 = window.open("", "","height=200, width=200");
    Win1.document.w rite('Right click!');
    }

    The problem is that the default menu that normally appears is still
    appearing. How do I suppress the right-click menu?

    Thank you
    Glenn



  • Matthew Hagston

    #2
    Re: Right Click Menu

    "MisterG" <glenn.buteau@r ogers.com> wrote in message
    news:IrednUC9sL-3OczfRVn-1g@rogers.com.. .[color=blue]
    > Using the following code I am able to open a new window when a user right
    > clicks an object in my document.
    >
    > if (window.event.b utton == 2) {
    > Win1 = window.open("", "","height=200, width=200");
    > Win1.document.w rite('Right click!');
    > }
    >
    > The problem is that the default menu that normally appears is still
    > appearing. How do I suppress the right-click menu?
    >
    > Thank you
    > Glenn
    >[/color]

    Initially I did this by inserting a clear 1x1 px gif at the mouse point
    while the mouse was down. There is an easier way to do it however by
    canceling the event. Can't seem to remember the trick off the top of my head
    though. I should have a copy stored on my home computer...but in the mean
    time i found this:



    --
    Matthew Hagston


    Comment

    • MisterG

      #3
      Re: Right Click Menu

      Thank you. That's all I needed!

      "Matthew Hagston" <otts1@earthlin k.net> wrote in message
      news:yfi4e.226$ go4.43@newsread 2.news.atl.eart hlink.net...[color=blue]
      > "MisterG" <glenn.buteau@r ogers.com> wrote in message
      > news:IrednUC9sL-3OczfRVn-1g@rogers.com.. .[color=green]
      > > Using the following code I am able to open a new window when a user[/color][/color]
      right[color=blue][color=green]
      > > clicks an object in my document.
      > >
      > > if (window.event.b utton == 2) {
      > > Win1 = window.open("", "","height=200, width=200");
      > > Win1.document.w rite('Right click!');
      > > }
      > >
      > > The problem is that the default menu that normally appears is still
      > > appearing. How do I suppress the right-click menu?
      > >
      > > Thank you
      > > Glenn
      > >[/color]
      >
      > Initially I did this by inserting a clear 1x1 px gif at the mouse point
      > while the mouse was down. There is an easier way to do it however by
      > canceling the event. Can't seem to remember the trick off the top of my[/color]
      head[color=blue]
      > though. I should have a copy stored on my home computer...but in the mean
      > time i found this:
      >
      > http://www.javascriptkit.com/script/...lickmenu.shtml
      >
      > --
      > Matthew Hagston
      >
      >[/color]


      Comment

      • Zifud

        #4
        Re: Right Click Menu

        Matthew Hagston wrote:[color=blue]
        > "MisterG" <glenn.buteau@r ogers.com> wrote in message
        > news:IrednUC9sL-3OczfRVn-1g@rogers.com.. .
        >[color=green]
        >>Using the following code I am able to open a new window when a user right
        >>clicks an object in my document.
        >>
        >>if (window.event.b utton == 2) {
        >> Win1 = window.open("", "","height=200, width=200");
        >> Win1.document.w rite('Right click!');
        >> }[/color][/color]

        Only in IE. There is no attempt to make it work in browsers that
        don't support window.event and it will be defeated by pop-up
        blockers.

        It likely won't work on systems that implement right mouse button
        functionality without actually having one.
        [color=blue][color=green]
        >>
        >>The problem is that the default menu that normally appears is still
        >>appearing. How do I suppress the right-click menu?
        >>
        >>Thank you
        >>Glenn
        >>[/color]
        >
        >
        > Initially I did this by inserting a clear 1x1 px gif at the mouse point
        > while the mouse was down. There is an easier way to do it however by
        > canceling the event. Can't seem to remember the trick off the top of my head
        > though. I should have a copy stored on my home computer...but in the mean
        > time i found this:
        >
        > http://www.javascriptkit.com/script/...lickmenu.shtml
        >[/color]

        That is IE specific code that does not work in any browser that does
        not support "window.createP opup", that has a pop-up blocker enabled
        or has JavaScript disabled.

        Changing the default behaviour of the user's interface only creates
        confusion, what is the point?


        --
        Zif

        Comment

        • MisterG

          #5
          Re: Right Click Menu

          Maybe for the internet, but this is an in intranet application requiring
          custom functionality, distributed on a standardized platform ( IE ). So it's
          perfect for our purposes.

          Thanks

          "Zifud" <Zifud@hotmail. com> wrote in message
          news:Lul4e.709$ Zn.38317@news.o ptus.net.au...[color=blue]
          > Matthew Hagston wrote:[color=green]
          > > "MisterG" <glenn.buteau@r ogers.com> wrote in message
          > > news:IrednUC9sL-3OczfRVn-1g@rogers.com.. .
          > >[color=darkred]
          > >>Using the following code I am able to open a new window when a user[/color][/color][/color]
          right[color=blue][color=green][color=darkred]
          > >>clicks an object in my document.
          > >>
          > >>if (window.event.b utton == 2) {
          > >> Win1 = window.open("", "","height=200, width=200");
          > >> Win1.document.w rite('Right click!');
          > >> }[/color][/color]
          >
          > Only in IE. There is no attempt to make it work in browsers that
          > don't support window.event and it will be defeated by pop-up
          > blockers.
          >
          > It likely won't work on systems that implement right mouse button
          > functionality without actually having one.
          >[color=green][color=darkred]
          > >>
          > >>The problem is that the default menu that normally appears is still
          > >>appearing. How do I suppress the right-click menu?
          > >>
          > >>Thank you
          > >>Glenn
          > >>[/color]
          > >
          > >
          > > Initially I did this by inserting a clear 1x1 px gif at the mouse point
          > > while the mouse was down. There is an easier way to do it however by
          > > canceling the event. Can't seem to remember the trick off the top of my[/color][/color]
          head[color=blue][color=green]
          > > though. I should have a copy stored on my home computer...but in the[/color][/color]
          mean[color=blue][color=green]
          > > time i found this:
          > >
          > > http://www.javascriptkit.com/script/...lickmenu.shtml
          > >[/color]
          >
          > That is IE specific code that does not work in any browser that does
          > not support "window.createP opup", that has a pop-up blocker enabled
          > or has JavaScript disabled.
          >
          > Changing the default behaviour of the user's interface only creates
          > confusion, what is the point?
          >
          >
          > --
          > Zif[/color]


          Comment

          • Matthew Hagston

            #6
            Re: Right Click Menu

            "MisterG" <glenn.buteau@r ogers.com> wrote in message
            news:EtydncX2tu gPV8zfRVn-gA@rogers.com.. .[color=blue]
            > Thank you. That's all I needed!
            >
            > "Matthew Hagston" <otts1@earthlin k.net> wrote in message
            > news:yfi4e.226$ go4.43@newsread 2.news.atl.eart hlink.net...[color=green]
            > > "MisterG" <glenn.buteau@r ogers.com> wrote in message
            > > news:IrednUC9sL-3OczfRVn-1g@rogers.com.. .[color=darkred]
            > > > Using the following code I am able to open a new window when a user[/color][/color]
            > right[color=green][color=darkred]
            > > > clicks an object in my document.
            > > >
            > > > if (window.event.b utton == 2) {
            > > > Win1 = window.open("", "","height=200, width=200");
            > > > Win1.document.w rite('Right click!');
            > > > }
            > > >
            > > > The problem is that the default menu that normally appears is still
            > > > appearing. How do I suppress the right-click menu?
            > > >
            > > > Thank you
            > > > Glenn
            > > >[/color]
            > >
            > > Initially I did this by inserting a clear 1x1 px gif at the mouse point
            > > while the mouse was down. There is an easier way to do it however by
            > > canceling the event. Can't seem to remember the trick off the top of my[/color]
            > head[color=green]
            > > though. I should have a copy stored on my home computer...but in the[/color][/color]
            mean[color=blue][color=green]
            > > time i found this:
            > >
            > > http://www.javascriptkit.com/script/...lickmenu.shtml
            > >
            > > --
            > > Matthew Hagston
            > >
            > >[/color]
            >
            >[/color]
            Well, the one I designed worked on all sytems including opera (providing you
            had javascript mouse events enabled). Haven't had time to find it yet
            though. That was just given as an example of how to do it that i could find
            easily on the net.

            --
            Matthew Hagston


            Comment

            Working...