I've encountered an issue while using jQuery to obtain the height of a specific element, as this measurement changes when someone resizes their browser window. Below is the code snippet I am currently using:
$(function() {
var wheight = $('.home').height(); // Retrieve browser window height
var wWidth = $(window).width(); // Retrieve browser window width
if (wWidth >= 992) {
$('.home').css('height', wheight);
}
})
$(window).resize(function() {
var wheight = $('.home').height(); // Adjust height upon browser resize
var wWidth = $(window).width(); // Adjust width upon browser resize
});
While this solution works perfectly in Firefox, it seems to encounter issues in Chrome specifically when shrinking the browser window. Interestingly, it does work as intended when expanding the browser window. Any suggestions on how I can resolve this inconsistency?