Here is my jQuery code for removing sticky class while scrolling down.
$(window).scroll(function (e) {
if ($('.main_form_wrapper').length != 0) {
var window_scroll = $(window).scrollTop();
console.log(window_scroll, "window scroll")
var bottom_position = window_scroll + $('.main_form_wrapper').outerHeight(true);
console.log(bottom_position, "form_position for footer")
var form_top_offset = $('.main_form_wrapper').offset().top;
console.log(form_top_offset, "form top offset")
var footer_top_offset = $('.top_footer').offset().top;
console.log(footer_top_offset,"footer top offset")
if (window_scroll > form_top_offset && bottom_position < footer_top_offset) {
$(".main_form_wrapper").addClass('sticky');
} else {
console.log('here')
$(".main_form_wrapper").removeClass('sticky');
}
}
});
please help anyone knows about it.