Recent Topics

Collapsible elements script

Started by on Jun 17, 2004 – Contents updated: Jun 17, 2004

Jun 17, 2004 22:16    

Anybody know of DOM based script that will work in ie 5+ win/mac and other standards supporting browsers.

I need the script to hide/show an element onclick and change the background image of the clicked element.

For instance.
I click on a <dt> and it toggles the <dd>, when this happens it also changes the <dt> background image position to give the appearance of an image swap.

Similiar to what is displayed on the b2evo home page, exept that b2evo uses list and images.

I like the collapsible elements script at www.onlinetools.org, but it fails in ie 5 and 5.5.

Any thoughts?

Jun 27, 2004 09:13

Were I in your shoes, I'd probably take a look at the source for the code that does the DOM stuff on b2evo's main page. It's probably something fairly easy to change around. Other than that, I'm not of much help to you.
/me thinks he should probably learn some DOM scripting one of these days...

Jun 28, 2004 21:07

The b2evo.net thing is really easy - even I can understand it!

It just toggles between two css classes basically, one with visibility set to hidden, the other displays. Pretty simple really.

Jun 28, 2004 21:39

actually if you want the <dd>text</dd> to disappear entirely and not leave blank space, use display:none and display:inline in your css.

CSS is my favorite "language"!
http://www.gothicwolf.net/blog/

Jun 28, 2004 22:22

Glad that there's another CSS-lover around here. Feel free to answer questions that get dropped in this forum. :)


Form is loading...

Photo gallery software – This forum is powered by b2evolution CMS, a complete engine for your website.