Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup on mouse over 1

Status
Not open for further replies.

Kadanis

Programmer
Mar 21, 2002
108
GB
Hiya. I'm pretty new to javascript programming so bear with me.

I am using some code in a DHTML help file for an application. I want to have popups when the user moves over a link so i can have a breif description.

I have the code sorted to get the popup

Code:
<A href="mainpage.htm" onmouseover="JavaScript:popup.TextPopup(strText,strFont,9,9,-1,-1)" >Main Menu</A>


but i cant get the popup to disappear afterwards. I assume it'll be on the onmouseout argument of the anchor but i dont know what the javascript command is.

Can anyone help

Thanks all :)

Heres the full html page for refercnce

Code:
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ARC Help File: Contents</title>
<link rel="stylesheet" href="style.css" type="text/css">

<script Language="JavaScript">
    strFont="Arial,10,,plain"
    strText="This is a pop-up window."
</script>

<object id="popup" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"></object>

</head>

<body>

<h3>&nbsp;Contents</h3>

<A href="mainpage.htm" onmouseover="JavaScript:popup.TextPopup(strText,strFont,9,9,-1,-1)" >Main Menu</A>

<hr>

</body>
</html>




 
Look at introducing an onmouseout event on the same href that triggered the onmouseover event.

Example:
Code:
<a href="mainpage.htm" onmouseover="popup.TextPopup(strText,strFont,9,9,-1,-1)" onmouseout=""popup.TextPopup('close')>Main Menu</a>

I have no idea what the code is to close your object popup... but I have put something in as a place holder. Please remember to set this up according to your object docs.

PS: You don't need to specify "Javascript:" when setting events like this.

Cheers,
Jeff
 
I've left a typo in my code sample... I closed the speech marks at the wrong place... they should enclose the onmouseout contents. Sorry.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top