CSS Extended Div Help Please?

Waning-Sun's picture
Would anyone be willing to share the code or explain to me how to get extended divs to work for more than one div? I have an extended div code, but I've never been able to figure out how to get it to function for more than one div, if that makes sense.

I feel like I've seen this code before floating around, but I can't seem to find them now. I appreciate any help anyone has to give.

Unfortunately the only coding I can get to work is HTML; javascript and CSS I can play with if I'm already given the code.

Thank you for the help and have a good day!
Aivilo's picture

You mean the accordion codes?

You mean the accordion codes?
Waning-Sun's picture

Kind of like the accordion

Kind of like the accordion divs, but the ones where you click on a div link and it'll reveal the div box under it or around it.
Avatar by Meadow. Siggy © Shey & Squeegie
Aivilo's picture

Oh. Those use an id instead

Oh. Those use an id instead of a class. An id will only work on one element (the first instance that appears in your code) and all other instances will be ignored. Change the id so that it's unique for each element and it should work for you.

For example, if your first one is div id="One" you should make your next one something else, such as div id="Two" or div id="supercalefragilisticexpialidocous"
AlisonRobin's picture

If you want to do it with two

If you want to do it with two different things you have to change Ids like Aivilo said. Ids have to be unique or javascript will just pick the first Id on the page and everything gets screwy.

You can do the visible/not visible div thing with javascript pretty easily and just copy this stuff with minor changes if you want it. That works on an individual basis with just one thing where you click a link and the thing will change from invisible to visible and vice versa but as long as you change Ids in the HTML and Javascript you can use it as many times as you want on one page.

Waning-Sun's picture

Ohh okay, I'll give that a

Ohh okay, I'll give that a try. I didn't see anything that had to do with a class or an id, but I'll play around with it. Thank you, Aivilo!


Edit: Ninja'd by Alison.

Thank you! I'll give that a try too.


I appreciate the help!
Avatar by Meadow. Siggy © Shey & Squeegie