I want to hide my sticky button when the slider or footer is being in view when scrolled upon.
I tried this code:
$(window).scroll(function() {
if ($(this).scrollTop() < 250) {
$("#sticky-button").css({
'display': 'none'
});
}
});
So what this does is to hide my sticky button when it is below 250px scroll height.
But on mobile, I realise it doesn't work as 250px in mobile is quite a huge height.
So how to do this by making it work upon a certain div (like: #slider, #footer) instead of setting that 250 height?