Dezinerfolio

Simple Javascript Accordions

Your rating: None Average: 4.5 (589 votes)
Virtual Img: 
One Line Description: 
Lightweight Accordion JS

Javascript accordians have been used a lot in todays web design world. There are a lot of scripts we have seen and sure you too would have seen them.

We hope our script is one of the smallest accordion script which is extremely simple and easy to integrate. Does’nt require any framework and fully cross-browser compatible.

  • The SMALLEST Accordion Javascript ( 1,149 bytes )
  • Easy Integration.
  • Does’nt require any Framework.
  • Can be used as a Tab system ( sample in the demo )
  • Fully Cross-Browser Compatible
  • Source Files Included.

Below is the snippet to control the accordion.
<body onload=”new Accrodian(’my-menu’,5,’heighlight’);”>

which is in form of:
<body onload=”new Accordian(’container of your accordion’,speed,’highlighted accordion class name’);”>

AttachmentSizeHitsLast download
Simple Javascript Accordions8.14 KB836342 min ago

Comments

Anonymous's picture

The script works great by itself, but when I inserted it to my web page which has other scripts, it just did not work well together. It seems to load okay at first, but when I click on any tab, the content keeps scrolling non-stop. Do you have any idea what might be the problem?
Thank you.

Laura Tran (not verified)
Fri, 05/29/2009 - 15:55
Anonymous's picture

I have the same problem but I try to delete other scipts and nothing!
I have a blogsite with wordpress and I have embeded this code in order to show posts with the accordion method. I have made single files like header.php, index.php etc. and the problem is that if I have a different file for header (that include from DOC Type to ) the other files, like index.php, loads the script but if I try to click on tabs the content scrolls non-stop. If I put the entire code of the header in each single file, all returns to work well.
Why there is this problem working wth multiple files?

Anonymous (not verified)
Wed, 06/03/2009 - 06:18
Anonymous's picture

If you want the content of the accordians to be invisible while the page is loading just set the div containing the content to display:none, easy as that!

Knarrenheinz (not verified)
Fri, 05/29/2009 - 00:21
Anonymous's picture

Just what I've been looking for, for a while now.

I've seen others but this seems lightweight and easy to use.

Thanks :D

Aden (not verified)
Thu, 05/28/2009 - 07:37
Anonymous's picture

If you want the single accordeon divs to stay open, just raplace the original onclick fundtion with this one.

h.onclick = function(){
for(i=0;i cn=this.c[i];
n=cn.substr(0,cn.indexOf('-'));
if((n+'-header')==this.id && dsp($(n+'-content'))=='none'){
ex($(n+'-content'));
n=$(n+'-header');
cc(n,'__');
n.className=n.className+' '+n.tc;
}else if((n+'-header')!=this.id && dsp($(n+'-content'))=='block'){
ex($(n+'-content'));
n=$(n+'-header');
cc(n,'__');
n.className=n.className;//+' '+n.tc;
}else if((n+'-header')==this.id && dsp($(n+'-content'))=='block'){
cl($(n+'-content'));
cc($(n+'-header'),'');
}
}
}

Thies (not verified)
Wed, 05/20/2009 - 04:56
Anonymous's picture

Hi, thanks for great code. However there is a bug in src version (but not in packed one). When you click serval times in selected div highlight style keeps appending (accordion_headings header_highlight header_highlight header_highlight header_highlight ...). Since I had to make some adjustments to the code I had to unpack your code (hope you don't mind).

lasic (not verified)
Sun, 05/17/2009 - 12:22
Anonymous's picture

Great component, so simple and small! Thank you, dezinerfolio :)

J :) (not verified)
Sat, 05/16/2009 - 22:49
Anonymous's picture

Great Menu and easy to implement. Thanks for making this available!

I was wondering if there's a way to open the panels with text links elsewhere on the page instead of clicking on the panels? If anyone can help me with that, I would be eternally grateful. Thank you so much!

NewHere (not verified)
Fri, 05/08/2009 - 23:57
Anonymous's picture

Okay, I've read through all 52 pages, and I'm still having problems making the accordions open via links on the same page instead of clicking on the accordion headers themselves. Please help, someone.

NewHere (not verified)
Fri, 05/08/2009 - 13:57
Anonymous's picture

I've noticed that when I put images into my accordion and open up the page, the accordion is fully expanded until all of the images are finished loading. Am I doing something wrong?

Brock (not verified)
Tue, 05/05/2009 - 07:41

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.