2
4

1 回答 1

1

I made 2 changes:

In the HTML I replaced the content of the div ('start') with this:

<span class="dragHandle" style="position: fixed">start</span>

In the JS I replaced your

$( ".drag" ).draggable();

with this:

    $( ".dragHandle" ).draggable({
        drag: function ( event, ui) {
            $(this).parent().offset({ top: ui.offset.top, left: ui.offset.left});
        }
    });

This way it's only the handle at the top that being dropped (and not the center of the tall DIV) and we still move your colorful DIVs :-)

于 2012-11-06T13:22:22.647 回答