There is such a code:

<div class="row row_cont"> <div class="col-sm-3 sidebar"> <div class="side_mnu">боковое меню</div> </div> <div class="col-sm-9 cont"> <div class="menu_top"> меню </div> <div class="posts"> посты </div> </div> </div> 

The bostrap grid is applied, the negative margin-top = "- 168px" is applied to the .sidebar block, the script needs to take the height of the .row_cont block and return it to the sidebar block by adding 168. I found a script that returns the height of all divas based on the height of the parent diva. But how can I add it so that the value is added specifically for the .sidebar block; I am not allowed by the lack of knowledge in javascript ((

 function setEqualHeight(columns) { var tallestcolumn = 0; columns.each( function() { currentHeight = $(this).height(); if(currentHeight > tallestcolumn) { tallestcolumn = currentHeight; } } ); columns.height(tallestcolumn); } $(document).ready(function() { setEqualHeight($(".row_cont > div")); }); 

    1 answer 1

     jQuery(function($) { var wrapper = $('.row_cont'), sidebar = $('.sidebar', wrapper); sidebar.height(wrapper.height() + 168); }) 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="row row_cont"> <div class="col-sm-3 sidebar"> <div class="side_mnu">боковое меню</div> </div> <div class="col-sm-9 cont"> <div class="menu_top"> меню </div> <div class="posts"> посты </div> </div> </div> 

    • Thank you very much, this is exactly what you need) - seledkapod