I have a modal window Bootstrap with dynamic height (more than height of screen). How can I scroll the window to bottom programmatically? I tried to do this:
$('#modal').animate({ scrollTop: $('#modal').height() }, 500);
But variable $('#modal').height() is not changing while I'm resizing window. Any ideas?
Solution is very easy:
$('#modal').animate({ scrollTop: $('#modal .modal-dialog').height() }, 500);
The other solution did not work for me however it was close.
Here is what worked for me:
$('#modal').animate({ scrollTop: $('#modal .modal-content').height() }, 'slow');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With