A msg box before opening the site

Asked

Viewed 148 times

-2

Good was wondering how to start doing that that appears in the img if there’s any way someone can provide a code base or something that helps me to do this I’ll be very grateful. inserir a descrição da imagem aqui

  • You want a screen of this for confirmation?

  • yes, before uploading the whole site wanted to put a screen of these

  • 2

    @Gabrielcosta recommend you to do the [tour] to understand how it works community, first try to do something, then ask the question by exposing your question and or problem.

  • Man, where I went wrong?

  • I’ve asked a few questions so far no one’s told me this, but you telling me I can fix it .

  • There are several javascript plugins that do this. I’ll leave two examples using jquery and creating the alert layout itself. Example 1: https://codepen.io/valdeir2000/pen/RxoYoj?editors=0010 Example 2 (Plugin Sweetalert): https://codepen.io/valdeir2000/pen/YpOVr?editors=0010#0 You can also use the Bootstrap, jQuery Modal, among others.

Show 1 more comment

1 answer

1


You can create these box box warning with 2 divs: one that will be the transparent dark background that will occupy the whole screen and another that will be the box with the warning, centered horizontally and vertically with display: flex.

I also created a function that will close the box box, which can be via pure Javascript or jQuery (all this is adaptable the way you want it).

Here’s an example you can adapt to your needs:

function fechaAviso(){
   document.querySelector("#tela").style.display = "none";
   // jquery abaixo
   //$("#tela").hide();
}
#tela {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: fixed;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: flex;
    justify-content: center;
}

#aviso{
   width: 300px;
   padding: 20px;
   background-color: #fff;
   border-radius: 10px;
   z-index: 999;
   top: 50%;
   align-self: center;
}

#aviso h2{
   margin: 0;
}
<p>Texto texto Texto texto Texto texto Texto texto Texto texto Texto texto</p>
<div id="tela">
   <div id="aviso">
      <h2>BOX DE AVISO</h2>
      <p>Texto texto Texto texto Texto texto Texto texto Texto texto Texto texto</p>
      <input type="button" value="Fechar" onclick="fechaAviso()" />
   </div>
</div>

  • Many thanks bro I’ll test here now, I had managed to make one, but it does not appear in googlechrome only in other browsers, ah and one more thing you have interest in making a php script for me? I’m looking for someone I can pay for, if that’s not allowed here sorry.

  • https://elojobmax.com.br/elojob or something similar to https://elojobbrasil.com.br/#loja. I wanted to mt learn php until pq short enough, but I need to leave the site ready until the 02, I wanted this system where you choose : the current link and the link you want the mode of the queue and appears the value.

  • opa ok bro I’ll call you.

  • I already sent you an email, I don’t know how you use Gtalk kk.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.