I have a list of users, I want to edit my code that when I click on a user, a popup appears containing the user information while the background gets greyed out. How can I do this?
Asked
Active
Viewed 622 times
1
-
It's a very broad question, but you would want to change the background colour of the `body` or `.container` programmatically when the modal is opened. – Obsidian Age May 20 '19 at 23:03
-
A common solution is to create a fixed/static div that completely covers the screen with a translucent black background. If you already have a popup/modal system in place, you could just use the container of the pop-up. [Example](https://www.w3schools.com/howto/howto_css_modals.asp) – Khauri May 20 '19 at 23:05
-
I think you mean the option keyboard: false You can look here: https://stackoverflow.com/questions/22207377/disable-click-outside-of-bootstrap-modal-area-to-close-modal – Y.Y. May 20 '19 at 23:07
2 Answers
0
For bootstrap:
$('#myModal').modal({
backdrop: 'static',
keyboard: false
});
For jquery:
$('#myModal').dialog({modal:true});

Manish Balodia
- 1,863
- 2
- 23
- 37

Y.Y.
- 664
- 1
- 6
- 22