9
我可以在mousedown(event)
事件中獲取光標位置,但不連續使用mousemove(event)
(因此會浪費資源)? event.pageX
回報上mousedown
沒有mousemove()的mousedown()上的jQuery鼠標位置()
我可以在mousedown(event)
事件中獲取光標位置,但不連續使用mousemove(event)
(因此會浪費資源)? event.pageX
回報上mousedown
沒有mousemove()的mousedown()上的jQuery鼠標位置()
NaN
代表詹姆斯:
從 - http://jsfiddle.net/interdream/JsaPG/3/
<input type="button" id="test" value="click" style="width:200px" />
$("#test").mousedown(function(e) {
console.log(e.pageX);
});
它哪種瀏覽器?在Chrome和Firefox中對我來說很好:http://jsfiddle.net/interdream/JsaPG/3/ –
@James:作品,我的代碼中的錯誤,很抱歉讓人不安:) –
沒問題,我認爲可能是這樣! –