xxxxxxxxxx
//After the image is loaded get height of the image from dom and set it to another element with testing codes
setTimeout(function() {
let srcreplace = './images/loginbg-mobile.png';
// replace source of $('img.bgBanner-mobile') with srcreplace
$('img.bgBanner-mobile').attr('src', srcreplace);
}, 5000);
//on document ready
$(document).ready(function() {
$('img.bgBanner-mobile').each(function() {
$(this).on('load', function() {
let imageHeight = $(this).innerHeight()
console.log({imageHeight})
if(imageHeight) {
//set the value of imageHeight as height to $('.headder-banner')
$('.headder-banner').height(imageHeight);
}
});
})
});