Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在jquery中从我的系统或其他窗口拖放_Jquery_Drag And Drop - Fatal编程技术网

在jquery中从我的系统或其他窗口拖放

在jquery中从我的系统或其他窗口拖放,jquery,drag-and-drop,Jquery,Drag And Drop,你好,我是JQuery的新手 我在我的网站上使用拖放插件 代码: 对于这两种方法,我需要使用以文件和对象的形式获取文件。我需要两种方式来使用拖放功能: 同页可拖放 从我的系统或其他窗口或其他浏览器 我需要支持旧的拖放功能和其他窗口或我的系统功能 我不知道如何解决这个问题。在文件[0]中,如何发送图像详细信息以供上传 $(".imageDrop").droppable({ scope:'preLast', drop: function(event, ui){

你好,我是
JQuery
的新手

我在我的网站上使用拖放插件

代码:

对于这两种方法,我需要使用以文件和对象的形式获取文件。我需要两种方式来使用拖放功能:

  • 同页可拖放
  • 从我的系统或其他窗口或其他浏览器
  • 我需要支持旧的拖放功能和其他窗口或我的系统功能

    我不知道如何解决这个问题。在
    文件[0]
    中,如何发送图像详细信息以供上传

    $(".imageDrop").droppable({
        scope:'preLast',
        drop: function(event, ui){
                $(this).prepend($("<div class='imgdiv'><img src='"+$(ui.helper).attr("src")+"' class='imageUpload' /></div>"));
                $(this).css("background","#fff");
              },
        over:function(event, ui){
                $(this).css("background","#c7e6ed");
              },
        out:function(event, ui){
                $(this).css("background","#fff");
              }
    });
    
    $(".imageattachNow").bind('drop', function (e) {
        var file = e.originalEvent.target.files ||  e.originalEvent.dataTransfer.files;
    });
    $(".imageattachNow").bind('drop dragover', function (e) {
        e.preventDefault();
    });