Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q490 Is it possible to determine the pixel coordinates of the mouse in relation to the screen when passing over a link, and then open a popup window in that position?

irt.org | Knowledge Base | JavaScript | Pointer | Q490 [ previous next ]

Q490 Is it possible to determine the pixel coordinates of the mouse in relation to the screen when passing over a link, and then open a popup window in that position?

This is only possible in Netscape Navigator 4 and Internet Explorer 4:

<script language="JavaScript"><!--
function showWindow(e) {
    var x=y=0;
    if (e != '') {
        x = e.screenX;
        y = e.screenY;
    }

    myWindow=window.open('apage.html','windowName',
        'width=100,height=100,screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y);
}
//--></script>

<a href="#" onMouseOver="if (window.event || document.layers) showWindow(event); else showWindow('');"><img src="picture.gif" width="200" height="200"></a>

<p>

<a href="apage.html" onMouseOver="if (window.event || document.layers) showWindow(event); else showWindow('');">A text link</a>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.