1
I need a responsive modal that adapts the height of the browser.
If the whole modal does not reach the height the scroll will not be shown, but if it exceeds the size/height, the scroll will be shown in the modal body. Header and Footer continue to be shown.
╔════════════════════════════X
║ **HEADER** ║ ---> height do modal (header + budy +
╠════════════════════════════╣ footer) tem que ser no máximo
║ - aaaaaaaaa ║ ║ to tamanho da janela/browser.
║ - eeeeeeeee ║ ║
║ - ddddddddd ║ ║
║ - aaaaaaaaa ║ ║
║ - ccccccccc ║ ║
║ - bbbbbbbbb ║v║ ---> Scroll (Somente no Body)
╠════════════════════════════╣
║ **FOOTER** ║
╚════════════════════════════╝
<div id="idModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body" >
- aaaaaaaaa
- eeeeeeeee
- ddddddddd
- aaaaaaaaa
- ccccccccc
- bbbbbbbbb
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
</div>
</div>
</div>
If the modal is of the height of the window, you want it to touch the top/bottom edges of the window or have the default margin?
– Sam
If the modal is small... would be centered on the screen... Horizontal is already ok here... my problem is the height... qdo very big surpasses the screen there has to go in the browser scroll and not the modal.
– Mamga
Are you using any bootstrap framework? Do you already have the modal working? If possible post what you already have of CSS and JS also so we can test with the modal working the way it is in your system.
– hugocsl
I am using modal/bootstrap. https://getbootstrap.com/docs/4.0/components/modal/
– Mamga