How to remove position fixed once reach footer.
How to set condition if i reach footer remove this fixed
jQuery(function($) {
function fixDiv() {
var $cache = $('#block-dailydeal-news');
var $cache1 = $('.footer-container ');
if ($(window).scrollTop() > 100)
$cache.css({
'position': 'fixed',
'top': '0px',
'z-index':'100000'
});
else
$cache.css({
'position': 'relative',
'top': 'auto',
'z-index':'auto'
});
}
$(window).scroll(fixDiv);
fixDiv();
});
Check offset every time you scroll the page
and make its position absolute if it has been downed under 10px before the footer.
Demo fiddle