jQuery.noConflict(); var width_window = jQuery(window).width(); document.write(' '); jQuery(document).ready(function() { var offsetTop = jQuery('.show_before_txt_ads').offset(); function tizer_scroll() { var bottomWindow = jQuery(window).scrollTop() - jQuery('.show_before_txt_ads').height(); console.log(jQuery(window).width() + ' ' + bottomWindow + ' | ' + jQuery(document).height() + ' ' + (bottomWindow + jQuery('.show_before_txt_ads').height() +300)); if(jQuery(document).height() < (jQuery(window).scrollTop() + jQuery('#bottom_block_rekl').height() + jQuery(window).height())){ jQuery('#bottom_block_rekl').css('display', 'none'); }else{ if(offsetTop){ if (offsetTop.top < bottomWindow) { jQuery('#bottom_block_rekl').css('display', 'block'); } else{ jQuery('#bottom_block_rekl').css('display', 'none'); } }else{ jQuery('#bottom_block_rekl').css('display', 'block'); } } } jQuery(window).scroll(function () { tizer_scroll() }); tizer_scroll(); });