URL にハッシュが含まれている場合、テーブルの最初の行をカバーする tablesorter の stickyHeaders ウィジェットに問題があります。
たとえば、living.php?tab=1#sacramento1
ページには正しいタブが表示され、正しい行にジャンプしますが、ヘッダーが行の上に表示されます。
これを回避するために、URL にハッシュがある場合は stickyHeader ウィジェットを無効にしています。
これが私がやっていることです:
<script type="text/javascript">$(document).ready(function()
{
//CHECK for hash. don't want sticky headers with hash
if (window.location.hash) {
var workingID = window.location.hash;
tid=workingID.substr(1,workingID.length);
document.getElementById(tid).setAttribute("class", "showRow");
// extend the default setting to always include the zebra widget.
$.tablesorter.defaults.widgets = ['zebra'];
} else {
// extend the default setting to always include the zebra widget and the sticky headers.
$.tablesorter.defaults.widgets = ['zebra','stickyHeaders'];
}
// extend the default setting to always sort on the first column
$.tablesorter.defaults.sortList = [[0,0]];
// call the tablesorter plugin
$("table").tablesorter();
}
);
stickyHeaders を取得してハッシュ行を認識し、ヘッダーの下に表示する方法はありますか?