Solved

Javascript expan collapse div

Posted on 2006-07-08
3
3,747 Views
Last Modified: 2008-01-09
Hello experts,

I am in need of javascript source code that would do the follwoing for me;-

http://www.obout.com/t2/ht_howto.aspx


Many Thanks
0
Comment
Question by:claracruz
3 Comments
 
LVL 4

Assisted Solution

by:Meritor
Meritor earned 150 total points
ID: 17064751
Here is the solution:

<html>
<script>
function showHide(val1,val2)
{
  document.getElementById('table1').style.display=val1;
  document.getElementById('show').style.display=val2;
  document.getElementById('hide').style.display=val1;
}
</script>


<div onClick="javascript:showHide('block','none');" id="show" style="display:block;cursor:hand;border-width:1;border-style:solid;">Click here to Show</div>
<div onClick="javascript:showHide('none','block');" id="hide" style="display:none;cursor:hand;border-width:1;border-style:solid;">Click here to Hide</div>
<Table id="table1" width=100% style="display:none;cursor:hand;border-width:1;border-style:solid;">
<TR>
<TD>
* your Stuff<br>
* your Stuff<br>
* your stuff
</TD>
</TR>
</table>
</html>
0
 
LVL 30

Accepted Solution

by:
callrs earned 200 total points
ID: 17065605
>>I am in need of javascript source code
Simple: In Internet Explorer, do this:
- View > Source
- Or hit the Edit button in the IE toolbar
0
 
LVL 16

Assisted Solution

by:OliWarner
OliWarner earned 150 total points
ID: 17065650
Moo.fx does a similar sort of thing with a small(ish) bit of JS and less markup in your HTML... It also looks nicer and lets your user know what's going on better... Its free so have a look:

http://moofx.mad4milk.net
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now