I have implemented a bootstrap modal into my project to create an elegant thumbnail gallery where users can view full-size images by clicking on the thumbnails. However, I have encountered an issue with adjusting the width of the modal div to fit the image properly.
Although I have been able to customize the CSS and everything is working well, I am struggling to dynamically adjust the modal div width based on the size of the image being displayed. Essentially, I want the modal to resize itself to accommodate different image sizes for a seamless full-sized display.
Below is the snippet of HTML code that I am currently using:
<div id="gallery" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<div class="modal-body"></div>
</div>
</div>
</div>
</div>
Any suggestions on how I can achieve my desired outcome? It's worth mentioning that I am using Bootstrap 3 for this project.