Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Pop-up não bloqueável com CSS e JavaScript</title>
- <style type="text/css">
- #popup {
- /*position: absolute;
- top: 30%;
- left: 30%;*/
- width: 300px;
- height: 150px;
- padding: 20px 20px 20px 20px;
- border-width: 2px;
- border-style: solid;
- background: #ffffa0;
- display: none;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- margin: auto;
- }
- </style>
- <script type="text/javascript">
- function abrir() {
- document.getElementById('popup').style.display = 'block';
- setTimeout ("fechar()", 15000);
- }
- function fechar() {
- document.getElementById('popup').style.display = 'none';
- }
- </script>
- </head>
- <body onload="abrir()" >
- <div id="popup" class="popup">
- Esse é um exemplo de popup utilizando o elemento <code>div</code>. Dessa maneira esse
- pop-up não será bloqueado, mas fechará em 15 segundos.
- <small><a href="javascript: fechar();">[X]</a></small>
- </div>
- <br><a href="javascript: abrir();">Abrir pop-up</a>
- <br><a href="javascript: fechar();">Fechar pop-up</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement