ページスクロールに基づいて要素をスクロールしようとしています。firefoxでは問題なく動作します。
$(window).scroll(function () {
var scrollOffset = $(this).scrollTop();
if (scrollOffset >= ele) {
$("#UserDataTable thead").css({ "position": "relative" });
$("#UserDataTable thead").css({ "background-color": "white" });
$("#UserDataTable thead").css('top', scrollOffset);
}
else {
$("#UserDataTable thead").css({ "position": "" });
$("#UserDataTable thead").css('top', ele);
}
});
// ここの ele は、移動しようとしている thead 要素の初期オフセットです。//
jsfiddle リンクは次のとおりです。
しかし、これはIE 8では機能しません。
このコードを機能させるために IE8 で必要な変更を教えてください。