I'm having a problem getting javascript to execute whenever I resize the browser window. I am using the following javascript:
$(document).ready(function(){
var heightNum = $('#work-details-info').height() + 39;
if (($(document).width() > 767) && ($(document).width() < 900)) {
$('#work-details-left-cntr').css("height", (heightNum));
}
});
It's calculating the height of a specific div. Then it is adding 39px to that height, and it sets the new height to another div. This works perfectly whenever I resize the page and then press refresh/reload. However, I want this to trigger without having to refresh/reload. How do I do that?