active question within accordion...
Hi there,
I've a question reg. 'active'.
On some pages I use the additional class = ".offen" to open the first node onLoad but I'm not able to get the depending h3 (class = aktiv) set to active.
Hoovering the H3s of the page works fine, also I do get the correct active status for H3s
after I've hoovered an element on the page.
Any hints? I did try to different (marked) solutions but none solved my probs...
-
$(document).ready(function() {
$('div.accordion> div').hide();
$('.offen').show();
//1st idea
// $('.aktiv').each(function() {
// if(this.href == window.location) $(this).addClass('active');
// });
// 2nd idea
// $('aktiv a:path').parent().addClass('active');
$('div.accordion> h3').click(function() {
var $nextDiv = $(this).next();
var $visibleSiblings = $nextDiv.siblings('div:visible');
if ($visibleSiblings.length ) {
$visibleSiblings.slideUp('normal', function() {
$nextDiv.slideToggle('slow')
});
} else {
$nextDiv.slideToggle('slow');
}
});
});
Thx
E.