jquery accordion height scroll issue solved

During one of my project we found some problem in open a vertical accordion when content inside the accordion more then the page height.

This code might be helpful for you solve your issue.

$(".ui-accordion-header").click(function(){
	//alert($(this).attr('id'));
	//alert($(this).parent().attr("id"));       
	/* Auto scroll for acordion*/
	var x = $(this).offset().left;
	var y = $(this).offset().top;
	//alert(x);
	//alert(y);
	$('html, body').animate({
		scrollTop:y
	 },'slow');
	/*Auto scroll for acordion ends*/
});

Share on Facebook



2 thoughts on “jquery accordion height scroll issue solved”