Answer the question
In order to leave comments, you need to log in
How to make modal windows dynamic in height?
Good evening everyone! There was a problem which I can not solve for several hours.
Here , I 'm laying out one template, after you enter, click on the red marker on the map. A window will appear. There are buttons in the footer that bring up similar windows. So here's the whole question. I want to make them a fixed hat and footer. By changing the height of the content of the window, and when the window is not retracted into the monitor in height, a scrollbar will appear inside, I did it using jquery.mCustomScrollbar .
The main.js file contains the code with which I implement this idea, it looks like this:
var dynamicDialogSize = function(){
var dialog = $('.dialog.dynamicDialogSize');
dialog.each(function() {
var el = $(this),
heightFull = el.height(),
dialogHeader = el.find('.dialogHeader'),
dialogContent = el.find('.dialogContent'),
dialogFooter = el.find('.dialogFooter');
dialogContent.innerHeight(heightFull - dialogHeader.innerHeight() - dialogFooter.innerHeight());
});
};
$('.dynamicDialogSize').on('show.bs.modal', dynamicDialogSize);
$(window).on('resize', dynamicDialogSize);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question