Using either pure Javascript or jQuery, how do I scroll the page so that the nth row in a table is centered on the page?
Some examples I\'ve seen that have this sort
Give this a shot:
/*pseudo-code*/ $("td.class").bind("click", function() { var y = $(this).position().top, h = $(window).height(); if(y > h/2) { $("body").animate({ scrollTop: y - h/2 }, 2000); }; });