How can I scroll to an element so that it's at the bottom of the scrolling div?
<p>I want to automatically scroll to an element but I can't get it to scroll so that #elem is at the bottom of the #crm_corp_scroll div. I tried using</p>

<pre><code>$j('#crm_corp_scroll').animate({scrollTop: $j('#'+elem).offset().top},'fast');
</code></pre>

<p>but it scrolls the div so that the element is at the top and out of view.</p>

<p>I tried the native scrollIntoView but it scrolls me to the middle of the element. I want the full element to be into view.</p>

<p><a href="http://jsfiddle.net/HLxGM/" rel="nofollow">jsFiddle for how it works right now</a>. I want it to scroll so row6 is at the bottom of #crm_corp_scroll.</p>

<p>Figured out a sollution: </p>

<pre><code>$j('#crm_corp_scroll').animate({scrollTop: ($j('#'+elem).offset().top - $j('#crm_corp_scroll').height() + $j('#'+elem).height() * 2) },'fast');
</code></pre>

<p>this scroll elem into view at the bottom of the #crm_corp_scroll div.</p>
