jquery accordion height scroll issue solved 2 comments


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




About Pragnesh Karia

Pragnesh Karia, Open Source Enthusiast, Software Professional, Software Developer, Technical Lead ,Magento, Joomla ,Joomla LMS , Moodel LMS ,PHP ,Mysql, Ajax, Javascript, Jquery, Linux, Fan of Open Sources , Annet Technologies , SEO Analyst , Mootools


2 thoughts on “jquery accordion height scroll issue solved