English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a web site for a band. I have a BIO section where you click on each band member's name and it displays a bio of them. Right now it is opening in a new window that can be closed...what I really want to happen is this:
When you click on the band member's name, it expands text below it that includes the bio...and when you click on that member's name again, it will collapse or hide it.

How do I go about doing this?

2007-04-17 02:52:03 · 1 answers · asked by Yoi_55 7 in Computers & Internet Programming & Design

1 answers

I did this on a website: here's the code I used:

Management

[Masquer
le contenu
]





with this as an external file:

var ie4 = false; if(document.all) { ie4 = true; }
function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }
function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId);
if (lText == 'Afficher le contenu') { link.innerHTML = 'Masquer le contenu'; d.style.display = 'block'; }
else { link.innerHTML = 'Afficher le contenu'; d.style.display = 'none'; } }


hopefully you will be able to retrofit it to your own needs - you can also look up the page and get the code for the entire page and see how it works with multiple entries

2007-04-17 03:03:31 · answer #1 · answered by circusmort 5 · 1 0

fedest.com, questions and answers