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); } });