Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Drag and drop in Mozilla

Drag and drop in Mozilla

Scheduled Pinned Locked Moved Web Development
question
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    russellsoft
    wrote on last edited by
    #1

    I need to realize drag and drop in Mozilla... There is event ondragstart in Internet Explorer... I need to handle such event in Mozilla... I have table with some text. I need drag it in Mozilla and drop in other application... How it can be realized???

    R 1 Reply Last reply
    0
    • R russellsoft

      I need to realize drag and drop in Mozilla... There is event ondragstart in Internet Explorer... I need to handle such event in Mozilla... I have table with some text. I need drag it in Mozilla and drop in other application... How it can be realized???

      R Offline
      R Offline
      russellsoft
      wrote on last edited by
      #2

      I did it myself... For example it can be looking like follow:[ Row1 Row2 ](#)document.onmouseup = DragStop; var dragTried = false; function TryDragStart() { dragTried = true; } function DragStop() { dragTried = false; } function DragStart() { if (dragTried) { netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var dragService = Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService); var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable) trans.addDataFlavor("text/unicode"); var textData = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); textData.data = "Done!!!"; trans.setTransferData("text/unicode", textData, textData.data.length * 2); var transArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); transArray.AppendElement(trans); dragService.invokeDragSession(dragService.TEXT_NODE, transArray, null, dragService.DRAGDROP_ACTION_COPY); } }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups