Results 1 to 2 of 2

Thread: Context Menu Help

  1. #1
    Join Date
    Nov 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Context Menu Help

    Hey guys! I'm using the Context Menu [first addition!]

    http://www.dynamicdrive.com/dynamici...ontextmenu.htm

    And so far, through research and finding codes, I've found some like:

    <div class="menuitems" url="javascript:location.reload()">Refresh</div>
    or
    <div class="menuitems" url="javascript:window.close()">Close</div>

    [these are used in the context menu]

    The functions for these is when you right-click and click on Refresh, the page will refresh. If you right-click and click Close, the window will close. However, I cannot find the 'Paste' and 'Copy' option that will work in the Context Menu. I tried stuff like:

    <div class="menuitems" url="javascript:window.copy()">Copy</div>

    But so far I have no luck in finding a way to put a copy or paste button into the Context Menu.

    Can someone please help me find the javascript for copying and pasting? Much appreciation.

  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

    Think about what you are doing first. All modern browsers have perfectly good context menus for those sort of things. Also many will not or can be set not to allow this type of context menu substitution. Also, emulating Paste and Copy are much more involved than simple commands such as the ones for close() and reload(). The close() method generally will not work unless the window was opened using javascript's open() method. If you insist, check out this thread from another forum I sometimes post in:

    http://codingforums.com/showthread.php?t=65106

    As I recall, we made quite a bit of progress in IE doing this and I believe someone else chimed in with ideas on how to do it in other browsers as well.
    - John
    ________________________

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

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
  •