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

Q194 How can I adapt the previous script so that a window opens and closes on onMouseOver and onMouseOut?

You are here: irt.org | FAQ | JavaScript | Window | Q194 [ previous next ]

<HTML>
<HEAD>
<STYLE><!--
#style1 { color: orange; text-decoration: none }
//--></STYLE>
</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript"><!--
function myvoid() {}

var popup = '';

function showpopup(message) {
    msgWindow=window.open('','windowname','width=200,height=200');
    msgWindow.document.write('<BODY>' + message + '<\/BODY>');
    msgWindow.document.close();
}

function closepopup() {
    if (!msgWindow.closed)
        msgWindow.close();
}
//--></SCRIPT>

<P>This is some text outside,
<A HREF="javascript:myvoid()" onMouseOver="showpopup('hello world')" onMouseOut="closepopup()">
<SPAN ID="style1">this is some text inside</SPAN></A>,
and this is more text outside

</BODY>
</HTML>

Feedback on 'Q194 How can I adapt the previous script so that a window opens and closes on onMouseOver and onMouseOut?'

©2018 Martin Webb