Collapsable Text

They have: 88 posts

Joined: Feb 2004

Does anyone know where I can get collapsable text?

For Example: The text says Biography, nothing else. Then, when you click on Biography, text appear under Biography.

Thanks!

He has: 1,380 posts

Joined: Feb 2002

You mean like taking a menu tree and modding it?

Check out this. You can mod it so it doesn't have the folder, has whatever image you want, and has the proper text underneath.

[English accent]Should work quite fantastically.[/English]

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Sure, check these pages:
http://dynamicdrive.com/dynamicindex5/index.html
http://www.hotscripts.com/JavaScript/Software/index.html

edit: Round One goes to Kyle. Smiling

edit2: careful, that one Kyle linked to is IE-only. Look for ones that say NS6/All if you can afford to. Wink

He has: 1,380 posts

Joined: Feb 2002

Good call, I didn't look for the browser compatibility.

Chroder's picture

He has: 91 posts

Joined: Mar 2004

Try this if you still haven't found one.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>MyTest</title>
    <strong>&lt;script language="javascript"&gt;
    function toggle(id)
    {
        var itm = false;
        if(document.getElementById)
            itm = document.getElementById(id);
        else if(document.all)
            itm = document.all[id];
        else if(document.layers)
            itm = document.layers[id];

        if(!itm)
            return false;
       
        if(itm.style.display == 'none')
            itm.style.display = '';
        else
            itm.style.display = 'none';
       
        return false;
    }
    &lt;/script&gt;</strong>
<body>

<a href="#" <strong>onclick="toggle('my_div_name')"</strong>>Toggle It</a>
<strong><div id="my_div_name" style="display:none"><b>This</b> is my <i>very</i> <u>cool</u> hidden text!</div></strong>

</body>
</html>
'

Important parts in bold Smiling

They have: 88 posts

Joined: Feb 2004

Great, thanks guys!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.