javascript - mouseenter is not firing when mousedown is fired in Internet Explorer 11 -
i have 2 lists in div tag. trying drag & drop type functionality in code. working chrome not working in ie
when mouse entered on div recording id "selected" or "removed" in "listselected" variable , in mouseup event checking on div mouse button released using variable "listselected". mousedown event implemented know starting div tag & user expecting drag operation.
but problem after mousedrag event fired, mouseenter event not firing in ie. working in chrome. when release button mouseenter or mouseover events firing not firing instantly while dragging.
it helpful if know how handle in ie. here code
html
<div id="lstrmv" style="float: left; background-color:antiquewhite" onclick="return mouseclick();" onmousedown="return mousedown(event,'removed');" onmouseenter="return mouseenter('removed');" onmouseout="return mouseleave(event, 'removed');"> <h5>removed transactions</h5> <asp:listbox id="lst_alltrn" class="defaultcursor" runat="server" rows="15" width="225px" height="200px" onclick="return mouseclick();" selectionmode="multiple"></asp:listbox> </div> <div style="float: left;"> </div> <div id="lstsel" style="float: left" class="drop" onmousedown="return mousedown(event,'selected');" onmouseenter="return mouseenter('selected');" onmouseout="return mouseleave(event, 'selected');"> <h5>selected transactions</h5> <asp:listbox id="lst_selectedtrn" class="defaultcursor" runat="server" rows="15" width="225px" height="200px" selectionmode="multiple"></asp:listbox> </div> script
function mouseleave(e, id) { if (listselected == id) listselected = ""; } function mouseenter(id) { listselected = id; } function mousedown(e, id) { listdrag = id; $('.defaultcursor').css('cursor', 'move'); dragging = true; } function mouseup(e) { if (dragging) { if (listdrag == 'removed' && listselected == "selected") alert("transaction selected"); else if (listdrag == 'selected' && listselected == "removed") alert("transaction removed"); } dragging = false; $('.defaultcursor').css('cursor', 'default'); }
Comments
Post a Comment