I have implemented drag and drop functionality in JQuery and html5 , its working great in chrome but stuck in Firefox following is my code where i am alerting id of dropped
Firefox requires that a user run the dataTransfer.setData
function in the event.
For you jQuery
users, that means the following code should resolve your issue:
function dragstartHandler(event){
event.originalEvent.dataTransfer.setData('text/plain', 'anything');
}
Future events on the same drag will now properly fire as you expected. Obviously you can replace the setData
arguments with more useful data.
According to https://developer.mozilla.org/en-US/docs/Web/Events/dragstart set data to null (like in html part of the example, or in the event function) with:
event.dataTransfer.setData('text/plain', null);
Chromium doesn't need of that.