Windows POPUP, how to create? [closed]

0

How do I stop creating a POPUP window, other than the ones that open a page on the internet? I need one that looks like a DIV, a block from when they access the site it appears before the person logs in with some information ...

With a close button also, it would be very useful ...

    
asked by anonymous 04.07.2017 / 14:39

2 answers

1

Young has already taken a look at bootstrap modals, they are very useful and easy to use.

Here's the link: link

On loading the page you can do a function and call it onload on page:

window.onload = function(){
    abrirModal(); 
}

And here's a simple example

    
04.07.2017 / 16:14
0

Basically created with CSS.

$(document).ready(function(){
    $(".close").click(function(){
        $("#openModal").hide();
    });
});
	.modalDialog > div {
		width: 400px;
		position: relative;
		margin: 10% auto;
		padding: 5px 20px 13px 20px;
		border-radius: 10px;
		background: #fff;
		background: -moz-linear-gradient(#fff, #999);
		background: -webkit-linear-gradient(#fff, #999);
		background: -o-linear-gradient(#fff, #999);
	}

	.close {
		background: #606061;
		color: #FFFFFF;
		line-height: 25px;
		position: absolute;
		right: -12px;
		text-align: center;
		top: -10px;
		width: 24px;
		text-decoration: none;
		font-weight: bold;
		-webkit-border-radius: 12px;
		-moz-border-radius: 12px;
		border-radius: 12px;
		-moz-box-shadow: 1px 1px 3px #000;
		-webkit-box-shadow: 1px 1px 3px #000;
		box-shadow: 1px 1px 3px #000;
	}

	.close:hover { background: #00d9ff; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid="openModal" class="modalDialog">
	<div>
		<a href="#" class="close" title="Close">X</a>
		<h2>Janela Modal</h2>
		<p>Esta é uma simples janela de modal.</p>
		<p>Você pode fazer qualquer coisa aqui, página de Login, pop-ups, ou formulários</p>
	</div>
</div>
    
04.07.2017 / 20:15