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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layers with Bad Behaviors......

Status
Not open for further replies.

shanona1

Technical User
Dec 13, 2004
34
US
I am trying to add submenus to my title bar, ones that will show when you mouse over, then hide when you mouse out. So I made my layer with the text, hid it, added the behavior to show on mouse over, and then added the behavior to hide on mouse out. When I go to preview in IE, nothing happens....at all...nothing....frustrated.... please help.
 
post a link to the page or the code used please

[Peace][Pipe]
 
<div id="worship" style="position:absolute; left:289px; top:239px; width:90px; height:47px; z-index:12; background-color: #000099; layer-background-color: #000099; border: 1px none #000000; visibility: hidden;" onMouseOver="MM_showHideLayers('worship','','show')" onMouseOut="MM_showHideLayers('worship','','hide')">
<table width="88" border="0">
<tr>
<td width="84"><div align="center" class="style6 style7">Sunday</div></td>
</tr>
<tr>
<td><div align="center" class="style8">Wednesday</div></td>
</tr>
</table>
</div>
 
Your div is set to hidden when the page loads. that means you cant have an onMouseOver event triggered. Look at this page
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
</head>

<body>
<div id="worship" style="position:absolute; left:289px; top:239px; width:90px; height:47px; z-index:12; background-color: #000099; layer-background-color: #000099; border: 1px none #000000; visibility: hidden;">
  <table width="88" border="0">
    <tr>
      <td width="84"><div align="center" class="style6 style7">Sunday</div></td>
    </tr>
    <tr>
      <td><div align="center" class="style8">Wednesday</div></td>
    </tr>
  </table>
</div>
<a href="#" onMouseOver="MM_showHideLayers('worship','','show')"  onMouseOut="MM_showHideLayers('worship','','hide')">Whatever
</a>
</body>
</html>

Cheech

[Peace][Pipe]
 
Thanks!! I figured it out LATE last night! Thanks for the info though, you rock!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top