How to make the height of one block take EVERY second and assign it to another block?

  • 0
    I already made it in JQuert so that the height of main is taken and assigned to the .SideBar block, but when the page scale is changed, the block retains the old height. I am having trouble getting the height to be picked up and assigned EVERY SECOND.
    P.S. tried setInterval, but for some reason then the script stopped working altogether, probably did something wrong, with this help is needed)
    <script type="text/javascript">
    	$(function() {
        	var height = $( 'main' ).height(); //получаем высоту одного элемента
        	$( '.SideBar' ).height(height); //записываем высоту другому элементу
    	});
    </script>
    JavaScript Jaxon Lawrence, Feb 17, 2020

  • 1 Answers
  • 0
    You probably need to listen to the resize event
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!