JqueryUI Drag: Cursor not at the same position as draggable element

后端 未结 1 808
萌比男神i
萌比男神i 2021-01-21 00:37

I am using the latest version of JQuery and JQuery UI to understand drag and drop features. I am facing a minor problem - mostly due to mouse drag.

As you

1条回答
  •  情深已故
    2021-01-21 00:53

    As I tried out and read through the link given by @konrad, I found that its a bug in Jquery UI - even in the latest version of it. The problem got solved as soon as I started using Jquery UI 1.9.2 version

    here is the updated fiddle: http://jsfiddle.net/deveshz/YvmFf/2/

    with same code:

    var zindex = 10; 
    $(".item").draggable({
        containment: "body",
        scroll: true,
        revert: function (event, ui) {
            $(this).css("border", "none");
            return !event;
       },
        start: function (event, ui) {
            $(this).css("z-index", zindex++);
            $(this).css("border", "2px solid #333");
        }
    });
    
     $(".stack_items").droppable({
        hoverClass: "over",
        drop: function (event, ui) {
            $("
  • ").html(ui.draggable.html()).appendTo(this); $(ui.draggable).remove(); } });

    It uses Jquery version 1.9.2 from http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js

    0 讨论(0)
提交回复
热议问题