I have a block (1), which at some point becomes fixed and sticks to the top of the page.
$(document).ready(function(){ $(window).scroll(function(){ var bo = $(window).scrollTop(); if ( bo > 300 ) { $('.akcii').addClass('fixedblock'); $('.left_side').addClass('fixedblockLeftSide'); $('.content_catalog').addClass('fixedblockContent'); } else { $('.akcii').removeClass('fixedblock'); $('.left_side').removeClass('fixedblockLeftSide'); $('.content_catalog').removeClass('fixedblockContent'); } });
However, upon reaching the “recently viewed items” block (2), it must stop. The difficulty is that block (3) is implemented with additional loading of goods, so it’s impossible to just calculate the length of the entire page and subtract block (2)