2013-04-07 41 views
1

我想拖我的階段,限制上,左,右,下有dragBounds,但它不工作kineticjs與dragBounds dragable限制 - 不運行

var stage = new Kinetic.Stage({ 
    container: 'container', 
    width: 578, 
    height: 363, 
    draggable: true, 
    dragBoundFunc: function(pos) { 
     var newY = pos.y < 50 ? 50 : pos.y; 
     return { 
      x: pos.x, 
      y: newY 
     }; 
    }, 
    dragBounds: { // it's not running 
     top: 10, 
     bottom: 300, 
     left: 0, 
     right: 500 
    } 
}); 

這裏是我的代碼http://jsfiddle.net/kien16/aUWY2/

回答