I\'m using the bootstrap collapse function, but when I open an element which has a lot of content, then open the next element, it jumps down and doesn\'t go to the top of the op
You can try this:
I used the following, works like a charm:
$("#accordion2").bind('shown', function() {
var active=$("#accordion_univlist .in").attr('id');
scrollhere('#'+active);
$('.closebutton-right').hide();
});
$('.accordion-heading').click(function () {
// Do something if you want to do on click else ignore this handler.
}
function scrollhere(destination){
var stop = $(destination).offset().top - 80;
var delay = 1000;
$('body,html').animate({scrollTop: stop}, delay);
return false;
}
It also gives a bounce effect, and I like it.