Edited anasnakawa code for those who don't need jQuery UI Accordion styling and wants to keep the code simple. (hope you'll find it useful)
HTML:
<div id="multiOpenAccordion">
<h3>tab 1</h3>
<div>A lot of text</div>
<h3>tab 2</h3>
<div>A lot of thex 2</div>
</div>
Javascript:
$(function(){
$('#multiOpenAccordion').multiAccordion();
});
Changed code:
(function($){
$.fn.extend({
multiAccordion: function(options) {
var defaults = {};
var options = $.extend(defaults, options);
return this.each(function() {
var $this = $(this);
var $h3 = $this.children('h3');
var $div = $this.children('div');
$h3.click(function(){
var $this = $(this);
var $div = $this.next();
if ($this.hasClass('closed')) {
$this.removeClass('closed').addClass('open');
$div.slideDown('fast');
} else {
$this.removeClass('open').addClass('closed');
$div.slideUp('fast');
}
});
});
}
});
})(jQuery);
Edit:
If you use Malihu custom scrollbar then there may be problems with IE. IE drops error saying
Invalid argument, Line xx, character xxx
I removed this code from Malihu scrollbar (which is responsible about scrolling content which is more than 1000px glitch) - It helped.
$.fx.prototype.cur = function(){
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}
var r = parseFloat( jQuery.css( this.elem, this.prop ) );
return typeof r == 'undefined' ? 0 : r;
}
This gave me real headache