"Modal On Load"
Bootstrap 4.1.1 Snippet by rafrancoso

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="modalMensagem" class="modal">
<div class="modal-content">
<span class="btn-fechar">×</span>
<img src="http://rsimoveismga1.tempsite.ws/images/ferias_coletivas.png">
</div>
</div>
<script>
var modal = undefined;
var fechar = undefined;
window.onload = function() {
modal = document.getElementById('modalMensagem');
fechar = document.getElementsByClassName("btn-fechar")[0];
modal.style.display = "block";
fechar.onclick = function() {
modal.style.display = "none";
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.modal {
display: none;
position: fixed;
z-index: 100;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
padding: 20px;
border: 1px solid #888;
}
/* The Close Button */
.btn-fechar {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.btn-fechar:hover,
.btn-fechar:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: