This is a discussion on "MooTools Accordion Advanced" within the JavaScript Forum section. This forum, and the thread "MooTools Accordion Advanced are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
MooTools Accordion Advanced
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
MooTools Accordion Advanced
Hi Guys.
I have attempted a slightly more advanced version of the popular MooTools - Accordion, but, have run into a few problems. What I want to do is, when an element is active, I want it's toggler to be a different colour to the rest of the togglers. So when a box (or element as they call it) is open, I want it to have the blue background image, while the other boxes are closed, I want them to have the white background image. However, with my JavaScript, when the page first appears - the box's toggler that's open is the only one with the blue image, but when I click on another toggler, that box keeps the blue image with the new one. So if I click on all of them, they are all blue, regardless of whether they are "open". Have a look here. This is my javascript:
Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
|
|
|||
|
Re: MooTools Accordion Advanced
Had been searching on Google for a solution and found this.
He's doing exactly what I want to do, but I don't want to copy & paste his code. Would anyone have any idea? Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
||||
|
Re: MooTools Accordion Advanced
I built an accordian function a while back. The idea was similar to yours, but it swapped out an entire div layer (background image/colour).
The CSS would then be as follows:
I'm pretty sure you can use this to your ends. Hope that helps. Stew
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
Re: MooTools Accordion Advanced
Jees...You're not an Advisor for Nothing!
Thanks So Much! I HAVE TO TRY IT FIRST THOUGH! Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
||||
|
Re: MooTools Accordion Advanced
Sorry, forgot to mention, that I set it to load all the images first, before you could run the accordian.
You will therefore need to add: onLoad="preloadImage(1)" to the body tag I built it for one of my first clients, but he has still to ask me to install it, which is strange as he has totally mucked up his site at the mo, ah well (means more work for 2008 ! ). Quote:
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: MooTools Accordion Advanced
oh, I must warn ou that this currently isn't good for accessibility.
At the mo, we need to know the height for the box to collapse and expand it by X pixels. This means that if you override the text height in your browser settings, the text starts to be cut off. I have found some other accordians out there that you may wish to also try: http://www.dezinerfolio.com/2007/07/...pt-accordions/ http://www.stickmanlabs.com/accordion/ http://www.solutoire.com/experiments...s/acc_ex3.html
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
Re: MooTools Accordion Advanced
Thanks Again!
The first link is by far the best I've seen! It doesn't even need a framework. Tks, Ed/.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What's up with MooTools and Script.aculo.us? | CloudedVision | JavaScript Forum | 2 | Apr 19th, 2008 12:00 |
| mootools tutorial? | CloudedVision | JavaScript Forum | 2 | Feb 8th, 2008 02:08 |
| MooTools - Accordion | Ed | JavaScript Forum | 25 | Nov 8th, 2007 00:11 |
| accordion help | karloff | JavaScript Forum | 0 | May 10th, 2007 14:38 |
| Doing the advanced URL tag doesn't work | Nick | Webforumz Suggestions and Feedback | 9 | Nov 29th, 2003 10:01 |