Results 1 to 7 of 7

Thread: Right click menu help?

  1. #1
    Join Date
    Apr 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Right click menu help?

    Hi i have a webpage with output from a database with all name like:

    Max
    Mike
    Bob
    Fred

    and i want to use this context menu on it: http://www.dynamicdrive.com/dynamici...ontextmenu.htm

    so when i right click on 1 of the names on the page it shows up, so if i right click on the word fred the menu would say Fred in 1 of the links, how would i do that?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You wouldn't. That script is too outdated to use for anything in the real world. This is because most modern browsers will no longer allow the co-opting of the default context menu.

    It was a bad idea to begin with in my opinion, even when it did work, because users often depend upon their context menus, and if they do, don't appreciate it when it is taken away from them.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    is there a script out there that can?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not that I know of. Browsers not allowing this type of thing has nothing to do with the particular script used.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I cannot complete the site without one i jsut need it to work in ie or firefox thats all.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    IE, perhaps - depending upon settings and version. FF, no. I'm not going to discuss this much further except to say:

    • It's a bad idea for reasons I already mentioned.
    • Your site should work fine without javascript anyway.
    • There is always another way to get the sort of navigational functionality you are looking for without co-opting the user's browser. It might not look like you originally thought, but it will work out.


    Unless of course you want to look into alternative means to set up your site so that it will not need this, but will still convey the navigational flow you intend. For that though, you should open a new thread, probably either in the HTML or Javascript forums.

    One thought that comes to mind is a select element.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    May 2007
    Location
    By the beach
    Posts
    23
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    You would need to attach a on click event listener to the document. This would catch the mouse button 2 click, cancel it (event), then display a DIV element simulating a right click menu. This however would not be a good solution for user navigation since no one right clicks except to view the source or save a image/file.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •