0
我是KineticJS的新手,無法在mousedown
上獲得舞臺的鼠標座標。我設法用mouseout
和mouseover
顯示座標,但mousedown
似乎只適用於已添加到舞臺的圖像/形狀,但不是舞臺本身。如何獲取我點擊的位置的鼠標位置,在kinetic.js階段?
任何人都可以向我解釋爲什麼這樣嗎?請幫我解決問題。
this is the example我試着用:
代碼:
stage.on('mouseout', function() {
var mousePos = stage.getMousePosition();
writeMessage(messageLayer, 'Mouseout triangle:' + mousePos.x);
});
stage.on('mouseout','mousemove', function() {
});
stage.on('mousedown', function() {
alert('OK!');
});
感謝兄弟,設法通過JQuery來完成它:) – Milind 2013-03-04 19:07:31