/    Sign up×
Community /Pin to ProfileBookmark

Make Row dissapear

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=”http://www.webdeveloper.com/forum/images/icons/icon7.gif” name=”menos” border=”0″ style=”cursor:pointer” onclick=”MM_showHideLayers(‘list’,”,’hide’)”>

<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>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @joao_br spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...