JQuery.on("drop") not firing

Asked
Active3 hr before
Viewed126 times

6 Answers

firing
90%

You need to cancel all events,I'm trying to implement drag and dropping of files from the desktop the browser window. I have used jQuery to attach three events to the HTML element as in the code below:, Double vertical line ,WordPress Development

You need to cancel all events

$("html").on("dragover", function(event) {
   event.preventDefault();
   event.stopPropagation();
   $(this).addClass('dragging');
});

$("html").on("dragleave", function(event) {
   event.preventDefault();
   event.stopPropagation();
   $(this).removeClass('dragging');
});

$("html").on("drop", function(event) {
   event.preventDefault();
   event.stopPropagation();
   alert("Dropped!");
});
load more v
88%

I'm trying to implement drag and dropping of files from the desktop the browser window. I have used jQuery to attach three events to the HTML element as in the code below:,However, the 'drop' event doesn't seem to fire at all, the dropped file simply opens in the browser window.,Btw, I am testing this in the latest version of Chrome and using jQuery 1.10.2.,The 'dragover' and 'dragleave' events work fine, displaying an inset border around the entire page when I drag a file over an removing it if I drag the file out again.

I'm trying to implement drag and dropping of files from the desktop the browser window. I have used jQuery to attach three events to the HTML element as in the code below:

$("html").on("dragover", function() {
   $(this).addClass('dragging');
});

$("html").on("dragleave", function() {
   $(this).removeClass('dragging');
});

$("html").on("drop", function(event) {
   event.preventDefault();
   event.stopPropagation();
   alert("Dropped!");
});
load more v
72%

I'm trying to implement drag and dropping of files from the desktop the browser window. I have used jQuery to attach three events to the HTML element as in the code below:,However, the 'drop' event doesn't seem to fire at all, the dropped file simply opens in the browser window.,Btw, I am testing this in the latest version of Chrome and using jQuery 1.10.2.,it is because it simulating drag event only without drop, use drag-n-drop instead.

I'm trying to implement drag and dropping of files from the desktop the browser window. I have used jQuery to attach three events to the HTML element as in the code below:

$("html").on("dragover", function() {
   $(this).addClass('dragging');
});

$("html").on("dragleave", function() {
   $(this).removeClass('dragging');
});

$("html").on("drop", function(event) {
   event.preventDefault();
   event.stopPropagation();
   alert("Dropped!");
});
load more v
65%

How to delete multiple records with Entity Framework ASP.Net MVC 5? C# | 3 days ago

1.2.$("html").on("dragover", function(event) {
   3. event.preventDefault();
   4. event.stopPropagation();
   5. $(this).addClass('dragging');
   6.
});
7.8.$("html").on("dragleave", function(event) {
   9. event.preventDefault();
   10. event.stopPropagation();
   11. $(this).removeClass('dragging');
   12.
});
13.14.$("html").on("drop", function(event) {
   15. event.preventDefault();
   16. event.stopPropagation();
   17. alert("Dropped!");
   18.
});
19.
75%

Events occur on the draggable target: There are three events which are used to drag an element from source location.  ,Supported Tags: It supports all HTML tags. ,Events occur on the draggable target,Events occur on the drop target:

40%

$(document).on('click', '.classname', function() {
   alert('clicked');
});

**
** Another Method ** **
   // where #wrapper is a static element in which you add the dynamic links.
   $('#wrapper').on('click', 'a', function() {
      alert('clicked');
   });
load more v

Other "firing-undefined" queries related to "JQuery.on("drop") not firing"