Solved

Javascript expan collapse div

Posted on 2006-07-08
3
3,753 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

822 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