Kind, as with resize fankshn recalculate the height minus 150 pixels. That is, there is a function that checks the height of the window and if the height is less than a certain value is transferred to a certain class, the height of the window object, is it possible to somehow transfer the height and recalculate it minus 150 pixels, something like that.

function msgHeightSize(){ if ($(window).height() <= '830'){ $('.msgs-scroll').css( 'height', $(window).height() ); } } $(window).load(function() { msgHeightSize() }); $(window).resize(function(){ msgHeightSize() }); 

    1 answer 1

     function msgHeightSize(){ if ($(window).height() <= '830'){ $('.msgs-scroll').css( 'height', (parseInt($(window).height())-150) + "px" ); } } $(window).load(function(){ msgHeightSize() }); $(window).resize(function(){ msgHeightSize() }); 
     .msgs-scroll{ border:2px solid red; } 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="msgs-scroll" ></div> 

    • Thank!!! exactly what is needed. - Anton Essential