javascript - How to detect default drag event of browsers using jquery -
suppose there text in browser. if select text, browsers allow dragging can see dragged text. need know when user dragged text. can partial text also.
if want detect if user drags text somewhere 1 of elements in page , not allow it, can try storing element's value in global var on keyup
function , passing value again on mouseenter
action.
var buff = ""; $("input[name=buff]").on("keyup", function(){ buff = $(this).val(); }); $("input[name=buff]").on("mouseenter", function(){ $(this).val(buff); });
check fiddle , try dragging text textbox. it's not working ie9 can events detect that.
Comments
Post a Comment