03-10-2008, 04:40 AM
|
#12 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
No, you can detect the mouse, heres some code to get the position:
Code:
function CursorPosition(e)
{
if (!e) e = window.event;
var cursor = {x:0, y:0};
if (!e)
{
return cursor;
}
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;
}
// Then you could do
function popup(e)
{
var pos = CursorPosition(e);
var popElem = document.getElementById('popup');
popElem.style.display = "block";
popElem.style.left = pos.x + '32';
popElem.style.top = pos.y + '32';
}
__________________
VillageIdiot can have my babbies ;d
|
|
|
|