Thursday, 15 May 2014

jquery - Detect if mousebutton is down on mousemove firefox -



jquery - Detect if mousebutton is down on mousemove firefox -

i'm trying drag div without having add together mouseup function because might bug if user has it's mouse outside window.

i tried using "e.which" chrome, ie , firefox , works fine ie , chrome firefox holds lastly clicked button used e.buttons firefox.

e.buttons worked great newest version tried using on firefox 14 wasn't supported.

do know of other solution?

code:

if(!drag_enabled || drag_enabled && !e.which || e.buttons != undefined && drag_enabled && !e.buttons )

return drag_enabled = false;

i have faced similar problem firefox while using e.which. changed code below works fine in browsers. hope help you.

function submitonenter(e){ if (!e) var evt = window.event; var charcode = e.keycode? e.keycode : e.charcode; if(charcode == "13"){ alert("enter pressed"); } }

and usage

<li onkeydown="submitonenter(event)" />

jquery firefox drag-and-drop mouseevent mousemove

No comments:

Post a Comment