How to make the browser, or actually, the site emit messages like those issued for you to subscribe to a newsletter from some website. I want this message to appear when I click the register button ...
How to make the browser, or actually, the site emit messages like those issued for you to subscribe to a newsletter from some website. I want this message to appear when I click the register button ...
This is the default method of sending messages via Javascript:
function msg() {
alert("Botão Clicado!");
}
<button onclick="msg()">Teste</button>
And here I am putting together a simple Modal call via Javascript / jQuery:
function msg() {
$("#mensagem").addClass('ver');
setTimeout(function() {$("#mensagem").removeClass('ver'); }, 3000);
}
#mensagem {
transition: all 0.52s;
background: #FFF;
border: #777 solid 1px;
box-shadow: 1px 1px 5px rgba(0,0,0,.52);
position: fixed;
top: -150px;
width: 50%;
padding: 25px 0;
text-align: center;
left: 25%;
opacity: 0;
}
#mensagem.ver {
top: 75px;
opacity: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><buttononclick="msg()">Teste</button>
<div id="mensagem">Muito Obrigado por sua Mensagem!</div>