Docs: fix search next/prev result positioning

This commit is contained in:
Rob Garrison 2016-04-20 06:59:51 -05:00
parent 77b503431c
commit 93515e05cd
2 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@
<script type="text/javascript" src="/path/to/jquery.tablesorter.widgets.js"></script> <script type="text/javascript" src="/path/to/jquery.tablesorter.widgets.js"></script>
</pre> </pre>
<p>tablesorter works on standard HTML tables. You must include THEAD and TBODY tags:</p> <p>tablesorter works on standard HTML tables. <strong>You must include THEAD and TBODY tags</strong>:</p>
<pre class="prettyprint lang-html">&lt;table id="myTable" class="tablesorter"&gt; <pre class="prettyprint lang-html">&lt;table id="myTable" class="tablesorter"&gt;
&lt;thead&gt; &lt;thead&gt;

View File

@ -74,8 +74,8 @@ jQuery(function($){
$collapsible.slideToggle(); $collapsible.slideToggle();
} }
if ($current.length) { if ($current.length) {
resultPosition = $current.position().top; resultPosition = $current.offset().top;
parentPosition = $collapsible.length ? $current.closest('tr[id]').position().top : resultPosition; parentPosition = $collapsible.length ? $current.closest('tr[id]').offset().top : resultPosition;
if (parentPosition + $(window).height() < resultPosition) { if (parentPosition + $(window).height() < resultPosition) {
parentPosition = resultPosition; parentPosition = resultPosition;
} }