When the block height is bigger than the browser height, the page should scroll to the block header like if there was an anchor to the header, so the user can see the begining of the block and not the end.
Thanks
Julien

Comments

pflame’s picture

Hi Julien,

Jquery UI accordion widget is not providing this feature by default. You can use following code in your custom module to scroll to selected block header.

Drupal.behaviors.accordion_blocks_customization = function() {
    $('.accordion_blocks_container').bind('accordionchange', function(event, ui){
	    var newHeader = ui.newHeader;
	    var newOffset = newHeader.offset();
	    window.scrollTo(newOffset.left, newOffset.top);
	});
}
shady_gun’s picture

Use the following code in the accordion_init.js after line 3 . You can set the scroll speed to any variable speed, The following code sets it to 10.

$('html,body').animate({scrollTop:0}, 10, 'ease');