標(biāo)題即效果有序。
var divr = document.getElementById("aboutus_cbboxrnewgsyw");
var divr_r = divr.right; //距離右邊距離
document.onscroll = function() {
var t1 = document.documentElement.scrollTop || document.body.scrollTop; //滾動(dòng)條 距頂距離 1167
var t2 = document.documentElement.scrollHeight || document.body.scrollHeight; //滾動(dòng)條 總長(zhǎng)
var t3 = t2 - t1; //滾動(dòng)條 距底部距離
if (t1 > 1167) {
if (t3 < 1400) {
$(".aboutus_cbboxrnewgsyw").css({
"position": "relative",
});
} else {
$(".aboutus_cbboxrnewgsyw").css({
"position": "fixed",
"width": "296px",
"top": "0",
"right": divr_r,
});
}
} else {
$(".aboutus_cbboxrnewgsyw").css({
"position": "relative",
});
}
}