Hari krishnan
Hari krishnan

Reputation: 2108

Dragging images in jQuery

I have developed an option that enables users to drag and drop images into a div and upload that image. For that i am using:

jQuery.event.props.push('dataTransfer');

and for getting files, i am using:

var files=e.originalEvent.dataTransfer.files;

But i noticed that i could get the files dragged from computer but could not get the image which is on the same page on browser.

Why is this so? Is there anyway to get the images dragged on the same page?

Thanks!

Upvotes: 0

Views: 74

Answers (1)

NielsC
NielsC

Reputation: 344

I can't get you an answer why it is like that because I haven't used drag and drop with jQuery. But I do know that HTML5 supports drag and drop. Maybe you can solve it with that :)

Upvotes: 3

Related Questions