2011-03-23 106 views

回答

8

尝试了这一点:http://jsfiddle.net/6JtMp/

下面的代码:

<style> 
    #draggable { width: 150px; height: 150px; padding: 0.5em; background-color: green; } 
    </style> 
    <script> 
    $(function() { 
     $("#draggable").draggable({ 
      start: function(event, ui) { $(this).css("height",10); }, 
      stop: function(event, ui) { $(this).css("height",150); }   
     }); 
    }); 
    </script> 



<div class="demo"> 

<div id="draggable" class="ui-widget-content"> 
    <p>Drag me around</p> 
</div> 

</div><!-- End demo --> 
1

什么drag

拖动(事件,UI)

触发而鼠标拖动期间移动,当前的移动发生前立即。

只需指定回调:

$("#draggable").draggable({ 
    drag: function(event, ui) { 
     // do something while dragging 
    } 
}); 
相关问题