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/
+1 dragBounds屬性已被刪除,以支持dragBoundFunc,它可以實現無限的拖放行爲 – 2013-04-08 04:56:31