public
Last active

Drag-n-Drop dataTransfer manipulation

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7
$('<image selector>').bind('dragstart', function(e) {
 
var old_src = e.originalEvent.dataTransfer.getData('text/html');
var new_src = old_src.replace('str_to_replace','str_replacement');
 
e.originalEvent.dataTransfer.setData('text/html', new_src);
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.