irt.org Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt

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?

You are here: irt.org | FAQ | JavaScript | Pointer | Q490 [ previous next ]

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>

©2013 Martin Webb

ArticlesFAQsGamesFeedback

FOLDOCRFCsInstant JavaScriptSoftwareBooksJavaScript Programmer's ReferenceAboutTop