- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › jQuery Accordion: Shrink inactive items?
Hey everyone. I’m creating an accordion as an image gallery preview/ navigation page but I’m having some trouble with it overflowing to the next line.
See here http://www.sebgonzdesigns.com/dev/designspec/index.html
I’m still rather new to jQuery and javascript in general, so I’m wondering what I’m missing. What I’m wanting it to do is expand one item, and collapse the others to fit in the space provided, rather than pushing it down to the next line. I’m unsure of what I need to use to make it collapse a little. I don’t want any of them to be open on page load (which was an issue I was facing until I figured out to just not call any of them as active). Basically, what I want is for them to behave like the ones in this Flash template (which is where I got the idea from).
CAUTION: Plays sound on load.
http://www.templatemonster.com/flash-templates/26041.html
Can someone point me in the right direction for this? I’d really appreciate all your help.
Well your #accordion isn’t big enough to support all the items when 1 is expanded. Which is why one is moved to below the others. Try increasing the width of the div around it, and everything should work out.
Also, use $(document).ready() when you use jquery to initialize it correctly.
Thanks. I ended up using the kwicks plugin for jquery. It made it really easy to set up.