/    Sign up×
Community /Pin to ProfileBookmark

dynamic hide/show content

Hi All,

I was trying to code an interactive way to displaying images. Ive created a table with two rows. The first row contains the person’s name, and the second row contains their pics and some extra info.

The issue is, I do not want the second row to be displayed always. I want to create a javascript that would display the second row, only when the name is clicked. Ive tried using the visibility:hidden style for the 2nd row and it works but, the table has a yellow background and I’m unable to resize to the area of the first row… To be clear, I do not want the yellow background to appear in the area of the 2nd row, when it’s hidden i.e. the name hasnt been clicked yet….

I was greatly appreciate any suggestions….

Thanks
raven

CODE:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Untitled Document</title>

<style type=”text/css”>
div.window{
position: absolute;
width: 640px;
height: 480px;
border: outset black 1px;
background-color: gray;
}

div.ShownMember {
background-color: yellow;
height: 1px;
}

div.hiddenMember {
background-color: yellow;
height: 20px;
}

#Infotext {
font-family: serif;
font-size: x-small;

}

</style>
</head>

<body>
<div class=”window” style=”position:absolute; left: 20px; top: 9px; z-index:0;”>
<div class=”ShownMember” style=”position:absolute; left: 200px; top:50px; z-index:100;”>
<table>
<tr> <td> <a ><center> <b>Name</b></center></a> </td> </tr>
<tr> <td>
<table id=”extraInfo” cellpadding=”0″ cellspacing=”0″ width=”100%” style=”visibility: hidden;”>
<tr> <td width=”75px”> <img src=”malik_small.jpg”> </td>
<td>Some Text</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>

</body>
</html>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinJan 16.2006 — don't use visibility, instead use style="block" for visible and style="none" for hidden
×

Success!

Help @0raven0 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...