要素の座標を取得する
function getPosition(node) { var x = 0, y = x; do { x += node.offsetLeft; y += node.offsetTop; } while (node = node.offsetParent) return {x: x, y:y}; }
function getPosition(node) { var x = 0, y = x; do { x += node.offsetLeft; y += node.offsetTop; } while (node = node.offsetParent) return {x: x, y:y}; }