I've encountered a challenge with my Bootstrap Modal when trying to set the width to 750px on large desktops. When resizing the window to a smaller size, the modal loses its responsiveness. To tackle this, I added a class to the modal to give it a fixed width of 750px and removed it when the window is less than 800px. The issue arises when the class remains deleted even when the window size goes back above 800px. How can I reapply the class when the window is larger than 800px? Here's what I have so far:
function checkWidth() {
if ($(window).width() < 800) {
$('div').removeClass('modal-width');
}
}
$(window).resize(checkWidth);