Answer the question
In order to leave comments, you need to log in
Is it possible to change the height of the sidebar in this way depending on the width of the screen?
On wide screens I want the height of the sidebar to be equal to the height of the post, but when viewed from phones, the sidebar runs under the post and I need the height of the sidebar to be determined as usual based on the content of the sidebar.
Is it correct to use such a function?
$(document).ready(function(){
var $winWidth = $(window).width();
if($winWidth > 757) {
$("#sidebar").css("height", $(".post").height());
}
;})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question