Phần kéo số (2) thì mình sử dụng overflow-y:hidden ẩn thanh cuộn nó đi
Mình muốn khi kéo thanh trình duyệt đồng nghĩa là kéo (2)
P/s: Toàn bộ forum ko chuyển động , chỉ có (2) nó chuyển đổi khi kéo (1) . Giống như khi ta kéo thanh (2) vậy
/* zzbaivong (devs.forumvi.com) */
$(function () {
var z = $(".box"),
a = z.prop("scrollHeight"),
b = z.height(),
c = $("html").prop("scrollHeight"),
d = $(window).height();
z.is(':visible') && a > b && c > d && $(window).scroll(function () {
z.scrollTop($(document).scrollTop() * (a - b) / (c - d))
})
});
$(function () {
//...
});
var fixadent = $("#fixadent"), pos = fixadent.offset();
$(window).scroll(function() {
if($(this).scrollTop() > (pos.top + 0) && $(this).scrollTop() < 15000 && fixadent.css('position') == 'static') { fixadent.addClass('fixed'); }
else if($(this).scrollTop() <= pos.top && fixadent.hasClass('fixed')){ fixadent.removeClass('fixed'); }
});
|
|