Reputation: 2126
I will make open bootstrap modal in mobile but I won't close it clicking by any button except if I resize resolution bigger than mobile version I want close to it
I have no any code and any idea how to possible ?
Upvotes: 0
Views: 198
Reputation: 1940
Option 1:
Give the modal the following class(es): hidden-md hidden-lg
.
Option 2: Use jQuery:
$(window).resize(function() {
if($(window).width < 968 /* or any other width */){
$('#mymodal').modal('hide');
}
});
Upvotes: 2
Reputation: 659
You Try code:
if(screen.width < YourWidth){
$('#modal').modal('hide');
}
Upvotes: 2