Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  4] [ 2]  / answers: 1 / hits: 20187  / 9 Years ago, tue, october 6, 2015, 12:00:00

So I have a Bootstrap modal I've created and I am trying to make it resizable using jquery. I have the resize working horizontally but if you try to resize vertically its like the content inside of the modal is not contained within the element I am trying to resize.



I tried using the 'alsoResize' property on the .resizable() and included all the divs within the modal but that seems to cause other issues.



$('.modal-content').resizable({
alsoResize: .modal-header, .modal-body, .modal-footer
});


Here is my example: https://jsfiddle.net/p7o2mkg4/


More From » jquery

 Answers
17

You actually did everything right! But the default overflow behaviour of HTML elements is visible. So if the parent element's content gets overflowed, they break out of the modal and that doesn't look good! So, you need to set the CSS overflow property to scroll or hidden to fix breaking on small size. Try adding:



.modal-content.ui-resizable {
overflow: scroll;
}


This will ensure scrolling on overflow of the element.



Link to JSFiddle: https://jsfiddle.net/p7o2mkg4/1/


[#64820] Saturday, October 3, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quinlanhenryf

Total Points: 743
Total Questions: 93
Total Answers: 118

Location: Australia
Member since Sat, May 27, 2023
1 Year ago
;