-2

这里有没有人有关于在 jQuery UI 中拖放元素的基本教程,比如图像、文本等。我​​非常感谢你的帮助,我真的需要它。

4

3 回答 3

1

You can go through following samples. it contains 25 ways to do this.

http://www.tripwiremagazine.com/2012/04/jquery-drag-drop-plugins.html

于 2012-07-10T02:48:45.757 回答
1

把自己打昏:

http://www.ericbieller.com/2010/06/24/how-to-create-a-simple-drag-and-drop-with-jquery/

于 2012-07-10T02:40:03.303 回答
0

由于您已经在使用 jQuery ,您可以考虑使用jQuery UI库。实现起来很简单

<div class="demo">      
  <div id="draggable" class="ui-widget-content">
     <p>Drag me to my target</p>
  </div>
  <div id="droppable" class="ui-widget-header">
     <p>Drop here</p>
  </div>    
</div>
 <script>
$(function() {
    $( "#draggable" ).draggable();
    $( "#droppable" ).droppable({
        drop: function( event, ui ) {
            $( this )
                .addClass( "ui-state-highlight" )
                .find( "p" )
                    .html( "Dropped!" );
        }
    });
});
</script>
于 2012-07-10T02:54:38.270 回答