I ran into a problem today where the accordion won't close. I have tracked it down to this function
$triggers.click(function(ev) {
console.log(ev);
if (ev.detail === 1 || !ev.detail) { // so we prevent double clicking madness (for not so savy web users) !ev.detail is for when its triggered by code
// so we keep accordions for each field group are independent (if using field groups)
var $ourTrigger = $(this);
var $contentToHandle = (grouped && (!usegroupheader)) ? $ourTrigger.parents(idSelector).children().children().children(contentSelector) : $content;
var $ourContent = $(this).next();
var $ourContentVisible = $ourContent.is(":visible");
console.log($ourContentVisible);
// if the one we clicked is open
if ($ourContentVisible) {
if(keeponeopen === 0) {
console.log($ourContent );
$ourContent.slideUp(speed);
$ourTrigger.removeClass(activeClass);
}
}
// otherwise
else if (!$ourContentVisible) {
if (!disablecloseothers) {
// if we have one open, close it
var $visibleContent = $contentToHandle.filter(':visible');
if($visibleContent.length) {
$triggers.removeClass(activeClass);
$visibleContent.slideUp(speed);
}
}
// and open our section
$ourContent.slideToggle(speed);
$ourTrigger.addClass(activeClass);
}
}
//disable link in header elements if needed
if (!enableheaderlinks) {
return false;
}
});
I changed
$ourContent.slideUp(speed) calls
to
$ourContent.hide();
to temporarily fix the problem. However the hide is a little more abrupt than the slideUp.
I am not receiving and console errors.
Thoughts on what might be going on?
Comments
Comment #1
manuel garcia commentedClosing now due to 6.x no longer supported.
Sorry for never getting around to replying here... too much for just one person.