Jump to content

MooTools Accordion Sliding Incorrectly


cesarcesar

Recommended Posts

My issue is that I am using nested accordions and the second accordion in my nested list will not push the outer div down. The nested accordion slides beneath the main div container.

 

Another way to put it, if i load the page, then click on "Meeting 2" it accordions correctly. But when i click on "Task 2.1", that accordion for that section opens, but hides behind the containing div. Now if I then click "Meeting 1", everything opens fine, and then if i click "Meeting 2" again, the contents of "Task 2.1" show correctly in full.

 

Any Ideas? Thanks for the help.

 

Here is some code i think may be useful.

 

Moo 1.2 used with this addEvent Javascript:

window.addEvent('domready', function() {
var meetingAccordion = new Accordion($$('.meeting_toggler'),$$('.meeting_element'),{

	opacity: false,
	show : -1,

	onComplete:function(el){
		if(el.getSize().y>0){
			el.setStyle('height','auto');
		}
	},

	onBackground:function(toggler,el){
		el.setStyle('height',el.getSize().y);
	}

});
var taskAccordion = new Accordion($$('.task_toggler'),$$('.task_element'),{

	opacity: false,
	show : -1,

	onComplete:function(el){
		if(el.getSize().y>0){
			el.setStyle('height','auto');
		}
	},

	onBackground:function(toggler,el){
		el.setStyle('height',el.getSize().y);
	}

});

});

 

html

<div style="border:1px solid green">

<div class="meeting_toggler">Meeting 1</div>

<div class="meeting_element">

	<div class="task_toggler">Task 1.1</div>

	<div class="task_element">
		Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
	</div>

	<div class="task_toggler">Task 1.2</div>

	<div class="task_element">
		Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
	</div>

</div>

<div class="meeting_toggler">Meeting 2</div>

<div class="meeting_element">

	<div class="task_toggler">Task 2.1</div>

	<div class="task_element">
		Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
	</div>

	<div class="task_toggler">Task 2.2</div>

	<div class="task_element">
		Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc., li tot Europa usa li sam vocabularium. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilit de un nov lingua franca: on refusa continuar payar custosi traductores. It solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.
	</div>

</div>

</div>

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.