Jump to content


Using MooTools Accordion script


8 replies to this topic

#1 cosmouse

    Young Padawan

  • Members
  • Pip
  • 77 posts
  • Location:Peoria, Arizona

Posted 25 August 2007 - 01:10 PM

I know absolutely nothing about javascript, so I have come here to see if anybody will walk me through or provide an example of how to use MooTool's Accordion script.

Here's the page I would like to use it (the javascript's already loaded):
http://ehko.net/admin/index.html

The way I would to use it is so that if a user clicks "add entry" (or any other tab), the text would drop down using the Accordion script.

Edited by cosmouse, 25 August 2007 - 01:11 PM.


#2 Lastcrime

    Impatient Jedi that likes to eat cereal

  • Members
  • PipPipPip
  • 649 posts
  • Gender:Male
  • Location:Toronto, Ontario, Canada
  • Interests:Soccer, Snowboarding, Hockey, B-ball, Skateboarding, Computers!

Posted 25 August 2007 - 01:41 PM

i dono the answer but i have a question how do you use mootools? like i downloaded it and its just a javascript file what do i do with it?

#3 _*Creative Insanity_*

  • Guests

Posted 25 August 2007 - 02:18 PM

The docs for this are pretty good and sure they will tell you all you need to know.

#4 .CJ

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Leeds, UK

Posted 25 August 2007 - 02:43 PM

Just read it up at http://demos.mootools.net/Accordion. At the top, click the js code | html code | css code links to see the code you need, or check the source of the page.

#5 cosmouse

    Young Padawan

  • Members
  • Pip
  • 77 posts
  • Location:Peoria, Arizona

Posted 25 August 2007 - 03:18 PM

I've read everything there is to read, and still don't understand. I've even copied and pasted directly from the demos and yet they haven't worked at all. If reading the documentation and seeing the demos would've helped, I wouldn't be posting right now.

#6 _*Creative Insanity_*

  • Guests

Posted 25 August 2007 - 03:45 PM

Maybe toss in the too hard basket then :rolleyes:

#7 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 25 August 2007 - 06:58 PM

Hey, don't really know if this will help you at all. But no content on your page is displaying due to the fact the <script> tags haven't been closed.

Edited by dEcade, 25 August 2007 - 07:00 PM.


#8 cosmouse

    Young Padawan

  • Members
  • Pip
  • 77 posts
  • Location:Peoria, Arizona

Posted 25 August 2007 - 07:40 PM

I've closed the script tags. Does anybody know an easy to use javascript accordion that has documentation not made for people who know javascript?

#9 .CJ

    Young Padawan

  • Members
  • Pip
  • 114 posts
  • Gender:Male
  • Location:Leeds, UK

Posted 25 August 2007 - 09:28 PM

Yeah, it's called Spry, it's from Adobe, it's very good, I use it.

Check out http://labs.adobe.com/technologies/spry/sa...dionSample.html pretty simple.

Just add your HTML with the correct ID's and just one line of Javascript will turn it into what you need.

<div id="Acc1" class="Accordion">
  <div class="AccordionPanel">
	<div class="AccordionPanelTab">Panel 1</div>
	<div class="AccordionPanelContent">
	BLAH BLAH BLAH
	</div>
  </div>
</div>

<script type="text/javascript">
var acc1 = new Spry.Widget.Accordion("Acc1");
</script>

Oh, I should point out you need to download the whole Spry library and include the required files. If stuck, a simple Google search for 'Spry' should help you.

Edited by .CJ, 25 August 2007 - 09:30 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users