Hello guys, I´m need some help with the MM_showHideLayers function.
I need to make a Row dissapear after I press a button, so I used the MM_showHideLayers finction. The problem is, it will only work id the div tag is placed out of the table tag that is in the <tr> tag and not the <tr> tag that is outside of the table. Here is the code;
<html>
<head>
<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>
<bofy>
<img src=”
<table>
<div id=”list” style=”z-index:1; visibility: visible;”>
<tr><!– This is the row that needs to dissapear –>
<td align=”left”>
<!– but it will only work if I place the opening div tag here –>
<table cellspacing=”1″ width=”90%” align=”left” >
<tr>
<td>Content</td>
</tr>
<tr>
<td>Content 2</td>
</tr>
</table>
<!– and the closing div tag here –>
</td>
</tr>
</div>
</table>
</body>
</html>