表のセルにカーソルを合わせたときに、マウスの横に div ポップアップを作成しようとしています。
<td onmouseover="bubblePopup("param1","param2");">This is the cell</td>
私の bubblePopup 関数でカーソル位置を取得することは可能ですか?
function bubblePopup(param1, param2){
var newdiv = document.createElement('div');
newdiv.setAttribute('id', param1);
newdiv.style.width = "200px";
newdiv.style.height = "80px";
newdiv.style.position = "absolute";
newdiv.style.left = cursorX + "px";
newdiv.style.top = cursorY + "px";
newdiv.innerHTML = "content";
document.body.appendChild(newdiv);
}
私はネイティブのjavascriptを好みます(ただし、jqueryオプションも検討します)。Firefox 3.5 以降でのみ動作する必要があります。