mouseover ignored w/ onclick

J

Joseph Scalise

Just as in subject; when I insert the onclick="self.close();" the
onMouseover is ignored in this code. This runs off a script that displays a
different tab for the mouseover, but I can't understand why onclick would
make a change.

Andyone have any ideas? The code is here:

<a onMouseover="expandcontent('sc2', this)" title="Close this window and
return to previous page." onclick="self.close();">Close Window</a>
 
M

Murray

expandcontent

Is this javascript function defined on the page? Can you post a link to the
whole page?

These two events would not be expected to conflict with each other....
 
J

Joseph Scalise

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Budget Information Help </title>
<style type="text/css">

#ddimagetabs{
}

#ddimagetabs a{
display: block;
text-decoration: none;
/*tab font */
color: black; /*font color */
width: 86px; /*width of tab image */
height: 22px; /*height of tab image */
float: left;
display: inline;
margin-left: 4px; /*spacing between tabs */
padding-top: 4px; /*vertical offset of tab text from top of tab*/
background-image:url('../lead/bluetab.jpg'); /*URL to tab image */
background-repeat: no-repeat;
text-align: center; font-style:normal; font-variant:normal;
font-weight:bold; font-size:12px; font-family:Arial
}

#ddimagetabs a:hover, #ddimagetabs a.current{
background-image:url('../lead/bluetabover.jpg'); /*URL to tab image
onmouseover */
color: black
}

#tabcontentcontainer{
width:480px; /*width of 2nd level content*/
height:40px; /*height of 2nd level content. Set to largest's content height
to avoid jittering.*/
}

..tabcontent{
display:none;
}

</style>

<script type="text/javascript">

/***********************************************
* DD Tab Menu II script- © Dynamic Drive DHTML code library
(www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=1 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes


////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display:
none;}\n</style>')

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function("return false")
if (document.getElementById && turntosingle==0){
highlighttab(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collectddimagetabs()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks.className=""
aobject.className="current"
}

function collectddimagetabs(){
var tabobj=document.getElementById("ddimagetabs")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
collectddimagetabs()
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

</script>
</head>

<body>
<div id="ddimagetabs" style="width: 420; height: 22">
<p align="center">
<a onMouseover="expandcontent('sc1', this)" target="I1" title="Personal
information screen." href="client_info.htm">
1. Personal</a>
<a onMouseover="expandcontent('sc2', this)" title="Close this window and
return to previous page." onclick="self.close();">Close Window</a></p>
<p align="center">
</p>

<p align="center">&nbsp;</div> <div align="left">
<table border="2" style="border-collapse: collapse" bordercolor="#8FBDEA"
width="650" height="453" cellpadding="3" align="left" bgcolor="#F2F7FF">
<tr>
<td width="643" height="1">
<p align="center">
<iframe name="I1" width="583" height="387" align="center" border="0"
frameborder="0" src="client_info.htm">
Your browser does not support inline frames or is currently configured
not to display inline frames.</iframe></td>
</tr>
<tr>
<td width="643" height="16">
<p align="center">
<font face="Tahoma" size="1"><b>Do you have any
questions?
Please contact our
Client Services Department at<br>
</b>(phone) 1-800-599-2227 (fax) 412-390-1336 (email)
<a href="mailto:[email protected]?subject=Client Service
Request">[email protected]</a></font></td>
</tr>
</table>
</div>
</body>

</html>
 
M

Murray

You have not properly implemented the function.

The mouseover event calls the expandcontent function with these details -

expandcontent('sc1', this)
----------------------^^^^

There is nothing on your page with this ID as required here -

//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

Thus, the mouseover event executes, discovers it has nothing to do, and
returns empty-handed, so to speak.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top