Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
sainathmurali committed Dec 30, 2023
1 parent 267b214 commit 3846eff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hmnn-assets/bannerimage.js
Original file line number Diff line number Diff line change
@@ -15,8 +15,11 @@ function updateBackgroundImage() {
}
}

// Trigger the function when the window is resized
window.addEventListener('resize', updateBackgroundImage);
// Call the function when the page is fully loaded
window.onload = function() {
// Introduce a delay to ensure the styles are applied after the image is loaded
setTimeout(updateBackgroundImage, 100);
};

// Trigger the function on page load
window.onload = updateBackgroundImage;
// Call the function when the window is resized
window.addEventListener('resize', updateBackgroundImage);

0 comments on commit 3846eff

Please sign in to comment.