0
您好HTML5開發人員,我試圖設置兩個不同的div作爲傳入文件的可拖動區域。但是,似乎只有其中一個可以同時處於活動狀態,我怎樣才能讓他們都準備好接受文件的dnd。這是我的代碼:設置兩個div作爲HTML5的可拖動區域
var node = dojo.byId("welcomeDialog1_Id");
var node2 = dojo.byId("firstDialogBackground");
// Reference
// http://www.html5rocks.com/features/file
// http://www.html5rocks.com/tutorials/dnd/basics/
// https://developer.mozilla.org/En/DragDrop/Drag_Operations
dojo.connect(node, "dragenter", function(evt){
// If we don't prevent default behavior here, browsers will
// perform the default action for the file being dropped i.e,
// point the page to the file.
evt.preventDefault();
});
dojo.connect(node, "dragover", function(evt){
evt.preventDefault();
});
dojo.connect(node, "drop", handleDrop);
dojo.connect(node2, "dragenter", function(evt){
evt.preventDefault();
});
dojo.connect(node2, "dragover", function(evt){
evt.preventDefault();
});
dojo.connect(node2, "drop", handleDrop);