Jquery UI Drag and Drop not working in IE9

陌路散爱 提交于 2019-12-25 05:25:25

问题


I have Jquery drag and drop working in firefox, but it does not work in IE9.

I turned on display script errors on IE9 but its not displaying any errors..

The demo site is http://www.aussiehaulage.com.au/default.aspx

I have the latest versions of Jquery and UI


回答1:


This issue will get fixed with this fix. Use this fix in your code and enjoy.

http://forum.jquery.com/topic/jquery-ui-sortable-and-draggable-do-not-work-in-ie9 This will be in jQuery UI 1.8.6.

If you can't upgrade to 1.8.6 (yet), this hotfix will allow older versions of jQuery UI drag-and-drop to work with IE9:

<script>
// HOTFIX: We can't upgrade to jQuery UI 1.8.6 (yet)
// This hotfix makes older versions of jQuery UI drag-and-drop work in IE9

(function($){
    var a=$.ui.mouse.prototype._mouseMove;
    $.ui.mouse.prototype._mouseMove=function(b){
        if($.browser.msie&&document.documentMode>=9){
            b.button=1
        };
        a.apply(this,[b]);
    }
}(jQuery));
</script>


来源:https://stackoverflow.com/questions/11914249/jquery-ui-drag-and-drop-not-working-in-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!