1

你能告诉我如何设置 makedroppane 函数的选项吗?我不知道。这是我的示例代码。

我知道它需要是一个字典数组,但我不确定要放它。在示例中,它只有 [0]。选项设置的实际文档中的示例会很好。

filepicker.setKey('###########');
var options = {
    "multiple": true
};
filepicker.makeDropPane($('#exampleDropPane')[0],options, {
    dragEnter: function() {
        $("#exampleDropPane").html("Drop to upload");
    },
    dragLeave: function() {
        $("#exampleDropPane").html("Drop files here");
    },
    progress: function(percentage) {
        $("#exampleDropPane").text("Uploading ("+percentage+"%)");
        $("#pb").css('width', (percentage)+'%');
    },
    done: function(data) {
        console.log(data);
        alert('done');
    }
});
4

1 回答 1

1

looks like you just need to combine your options into one map:

filepicker.makeDropPane($('#exampleDropPane')[0], {
   multiple: true,
   dragEnter: function() {
    //  $("#pb").addClass('show');
    $("#exampleDropPane").html("Drop to upload");
   },
   dragLeave: function() {
    //      $("#pb").addClass('show');
    $("#exampleDropPane").html("Drop files here");
   }, ...
  });

The syntax is filepicker.makeDropPane(dropPane, options) - more information at https://developers.filepicker.io/docs/web/#local-drop

于 2012-09-24T05:21:22.637 回答