Ajaxianでこのスニペットを見つけましたが、cursor.y(またはcursor.x)を変数として使用できないようで、関数がそのように呼び出されると機能しないようです。構文の問題か何か他のものがありますか?
function getPosition(e) {
e = e || window.event;
var cursor = {x:0, y:0};
if (e.pageX || e.pageY) {
cursor.x = e.pageX;
cursor.y = e.pageY;
}
else {
cursor.x = e.clientX +
(document.documentElement.scrollLeft ||
document.body.scrollLeft) -
document.documentElement.clientLeft;
cursor.y = e.clientY +
(document.documentElement.scrollTop ||
document.body.scrollTop) -
document.documentElement.clientTop;
}
return cursor;
}
jQuery とライブラリは、ほとんどの JS プログラミングにとって少しやり過ぎだといつも思っていたので、できれば jQuery UI を使用しないことをお勧めします。