Solved

Javascript expan collapse div

Posted on 2006-07-08
3
3,737 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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

772 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

12 Experts available now in Live!

Get 1:1 Help Now