必要なポイントに到達すると固定されるように、ページネーション用のバーを作成しました...ページが1ページあたり20記事と十分に長い場合、すべて問題ありません...ページが10記事ほど短い場合ページごとに、すべてがFirefoxで動作しますが、バーが20〜30pxの必要なポイントの後ろに「飛び出している」ため、クロムに問題があるようです...これを解決する方法を知っている人はいますか? ページが短い場合にのみクロムで動作しないのはなぜですか? ページが長い場合でも、なぜですか?
ご協力いただきありがとうございます...
window.onscroll = function() {
var haut = (document.body.clientHeight);
if (haut > 900) {
var scroll = (document.documentElement.scrollTop || document.body.scrollTop);
var limit = document.getElementById('conststick').offsetTop - 52;
if (scroll > limit) {
document.getElementById('stick').style.position = 'fixed';
document.getElementById('stick').style.top = 52 + 'px';
document.getElementById('stick_linear').style.height = document.getElementById('stick').clientHeight + 'px';
} else if ((scroll < limit) || (scroll === limit)) {
document.getElementById('stick').style.position = 'relative';
document.getElementById('stick').style.top = 0 + 'px';
document.getElementById('stick_linear').style.height = 0 + 'px';
}
}
}