I have the following code:
JAVASCRIPT
//fix lateral filter and gallery on scrolling
$('.cd-filter-trigger').click(function () {
(!window.requestAnimationFrame) ? fixGallery() : window.requestAnimationFrame(fixGallery);
});
function fixGallery() {
var offsetTop = $('.cd-main-content').offset().top,
scrollTop = $(window).scrollTop();
( scrollTop >= offsetTop ) ? $('.cd-main-content').addClass('is-fixed') : $('.cd-main-content').removeClass('is-fixed');
}
This code performs the fixation of a slash on the side (a filter), however, after the user clicks and the slash is fixed, it should continue to fix only in the (.cd-main-content) area, meanwhile. , it stays fixed on the entire side of the page .... How can I fix this?