Results 1 to 4 of 4

Thread: Need help with collapsible/folding section

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    Question Need help with collapsible/folding section

    I have been trying to figure out how to collapse paragraphs of text by default to make my page look cleaner and have more whitespace. Basically, I have long descriptions but I want to only make them available or expand when a user clicks a word such as "more." Could anyone give me pointers on how to accomplish that? I did my page using Frontpage 2002 and I know they have collapsible outlines feature but I don't think that suits my needs. Thanks for any help I can get.

  2. #2
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,154

    Default

    Here you go...This is just for you!

    Code:
    <html>
    <head>
    <script language="javascript" type="text/javascript">
    function showhideDiv(ID) {
    	var divID = document.getElementById(ID).style;
    	
    	if (divID.display == 'block') {
    		divID.display = 'none';
    	}
    		else {
    		divID.display = 'block';
    		}
    }
    </script>
    </head>
    
    <body>
    <table width="50%" border="0" cellspacing="1" cellpadding="1">
      <tr>
        <td>ALL YOU NEED TO KNOW <a href="javascript:showhideDiv('table1');">show/hide</a> </td>
      </tr>
      <tr>
        <td>
    	
    	<div id="table1" style="display:block;">
    	<table width="100%" border="0" cellspacing="1" cellpadding="1">
              <tr>
                <td>blah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blahblah blah</td>
              </tr>
            </table>
    	</div>
    	
        </td>
      </tr>
    </table>
    </body>
    </html>
    Last edited by areidmtm; 04-26-2006 at 05:39 PM.

  3. #3
    Join Date
    Apr 2006
    Posts
    2

    Default areidmtm, thanks but I haven't got it to work

    Tried out your code. Didn't quite work for some reason. When I click show/hide, the "broken url" page shows up. Do you have a site using this code snippet already which I can check out?

  4. #4
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,154

    Default

    I'll PM it to you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •