Basically I want to get the height of .r-side
and have it applied to the height of .l-side
so that these two elements are always the same height even if the window is resized, and positioned on top of each other. I'm not sure what's wrong with my jQuery.
Here's what I got:
$(window).load(function(){
$(".l-side").css({'height':($(".r-side").height()+'px')});
});
Using jQuery 3.1.1. And here's a jsFiddle of the issue I'm having.
I'm open to other methods than jQuery to accomplish this but in my research I only found solutions that were specific to columns, and these divs need to be positioned directly on top of each other.
You have referenced
.l-side
and.r-side
as classes in the jQuery, and coded them as ID's in the markup :)In the snippet I altered your widths so it displays in the preview window, but you can see the heights now match.