There is a block on the site:

<div id="blc3"></div> 

After moving this block, another block appears. An example can be viewed in VK.com, if you scroll down the page, after closing all the left blocks, the width of the wall is extended. How to solve this problem?
Thank you for attention!

    1 answer 1

    Yes, everything is simple!

    Find out the height of the block #blc3 :

     var blc3_height = $('#blc3').height(); 

    When scrolling

     $(window).scroll(); 

    check scroll height:

     $(window).scrollTop(); 

    If the height of the scroll is greater than the height of the block #blc3 , then expand the other blocks:

     var blc3_height = $('#blc3').height() , if_max_width = false; $(window).scroll(function() { var top_scroll = $(this).scrollTop(); if(top_scroll > blc3_height && !if_max_width) { if_max_width = true; $('.blocks').css('width', 500); } else if(top_scroll < blc3_height && if_max_width) { if_max_width = false; $('.blocks').css('width', 200); } });