how to make a modal stay center of screen

Solutions on MaxInterview for how to make a modal stay center of screen by the best coders in the world

showing results for - "how to make a modal stay center of screen"
Constanza
01 Mar 2019
1//add a  onclick function to your modal button
2<button type="button" class="header__button" data-toggle="modal" data-target="#signUpModal" onclick="modalCenter()">
3	signup
4</button>
5//add below function to your scripts
6function modalCenter() {
7        $('#signUpModal').css({
8            'display': 'flex',
9            'justify-content': 'center',
10            'align-items': 'center'
11        })
12    }