I'm using bootstrap modal to show images.
How do I simply make Twitter Bootstrap
modal window bigger?
I'm using code from the (related) question:
$('#myModal').modal({
backdrop: true,
keyboard: true,
show: false
}).css({
// make width 90% of screen
'width': function () {
return ($(document).width() * .9) + 'px';
},
// center model
'margin-left': function () {
return -($(this).width() / 2);
}
});
But here's the result:
I have to scroll it down. How do I keep image ratio and show it without a scrollbar?
I'm using bootstrap modal to show images.
How do I simply make Twitter Bootstrap
modal window bigger?
I'm using code from the (related) question:
$('#myModal').modal({
backdrop: true,
keyboard: true,
show: false
}).css({
// make width 90% of screen
'width': function () {
return ($(document).width() * .9) + 'px';
},
// center model
'margin-left': function () {
return -($(this).width() / 2);
}
});
But here's the result:
I have to scroll it down. How do I keep image ratio and show it without a scrollbar?
Share Improve this question edited May 23, 2017 at 12:01 CommunityBot 11 silver badge asked Jun 18, 2013 at 7:59 lexemelexeme 2,97314 gold badges63 silver badges129 bronze badges 2- 2 Completely irrelevant, but I do not like camelcased css selectors. But that is just a matter of taste :) – nathanvda Commented Jun 18, 2013 at 8:17
- Me too. I like splitting them by a dash. I've just copied it from source and that's all:) – lexeme Commented Jun 18, 2013 at 8:24
1 Answer
Reset to default 4When we show images with bootstrap modal, we use the following css:
#myModal {
max-height: 80%;
overflow-y: auto;
.modal-body {
max-height: none;
text-align: center;
}
}
And then just do
$('#myModal').modal("show");
The crux is setting the max-height
on .modal-body
to none
.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745317817a4622299.html
评论列表(0条)