2011-12-13 91 views
1

我一直在使用JQuery UI ui.Draggable。 而當我滾動該段時,div在與其父元素同時拖動。 任何人都可以幫助我如何臨時禁用拖動滾動?滾動時不希望的拖動

<div class="note"> 
     <p> 
     Lorem Ipsum is simply dummy text of the printing 
     and typesetting industry. Lorem Ipsum has been the 
     industry's standard dummy text ever since the 1500s, 
     when an unknown printer took a galley of type and 
     scrambled it to make a type specimen book. It has 
     survived not only five centuries, but also the leap 
     into electronic typesetting, remaining essentially 
     unchanged. It was popularised in the 1960s with the 
     release of Letraset sheets containing Lorem Ipsum passages, 
     and more recently with desktop publishing software like Aldus 
     PageMaker including versions of Lorem Ipsum. 
     </p> 
</div> 



$(function(){ 
      var str = "div.note"; 
      var el = $(str); 
      var er = $(str+' p'); 
      $this = er; 

      el.draggable().resizable(); 

      el.bind('resize', function(){ 
      var node = $(this); 
      var size = Math.pow(node.width(),2) + Math.pow(node.height(),2); 
      size = Math.sqrt(size); 
      node.css({'font-size':(size/2)+'%', 'padding':(size/24)+'px'}); 
      });  
}); 

問候

+0

我試過的jsfiddle你的榜樣,我不能看看問題是什麼:http://jsfiddle.net/s65UR/ 你可以做一個,所以我們可以嘗試嗎? – BiAiB

+0

你的例子中有問題。抓住滾動線,而不是滾動,你拖着馬車滾動!在這裏,更大的div更容易注意http://jsfiddle.net/s65UR/1/ – kidwon

回答