Open message window inside html page

-1

I've been trying to do this for a long time, but I do not know how, like, many sites have a link that when you click opens a window as if it were a more fixed popup on the page, but I already tried everything already fucei in the source code of the others still can not even get it ...

I do not know if I can link here, but it's kind of what this site looks like: link

Inside the post in the part " DOWNLOAD - SUBSCRIBERS " when you click opens that custom window ...

How do you do this, type I currently have to use a popup window to display a small form, but if I could do that window I would put an iframe in it and would be much better to access ... if anyone knows how it does pf help.

So in the window I would get the frame maybe a text of 2 lines at most and a button close only, now the size and design I turn people just want the same idea.

    
asked by anonymous 08.06.2017 / 19:32

2 answers

1

Probably what you want to do is a modal. With bootstrap to make it very easy. Example here: link

Here's an example of how it works: JsFiddle

    
08.06.2017 / 19:34
0

I know the question has already been answered, but just for the sake of learning I am posting this other code, made 100% in the arm. With enough help I was able to make a simple alert type box with a close button, with css and javascript. I say it's 100 times more practical to use the bootstrap, I do not know if it's your case, but I'm still starting to study programming, it's even fun and challenging to learn how simple programs, or in this case an alert box / dialog are made part by part, or even 0, but some things that seem easy become difficult. But I repeat, it's just for learning. The code ...
Are two files, iframe.php and iframe2.php, test if you want. (the code is practically raw, nothing that a css does not solve).

iframe.php

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>    
    <div id="janela" style="display: none; position: absolute;">
      <iframe id="iframejanela" name="iframejanela" frameborder="3" style="height: 200px;"></iframe>
    </div>
    <input type="button" name="alert" id="alert" value="Clique" onClick="javascript: abrir();">
  </body>
</html>
<script language="javascript">
  function abrir(){
    document.getElementById('janela').style.display='';
      window.open('iframe2.php', "iframejanela");
}
</script>

iframe2.php

<DOCTYPE html>
<html>
  <head>
    <style>
/*Tamanho do alert*/
      .alert{
        padding: 20px;
        background-color: #EDEDED;
        color: #000000;
        cursor: default;
        width: 100px;
        height: 100px;
      }
/*Botão de fechar*/
      .closebtn{
        margin-left: 15px;
        color: #000000;
        float: right;
        font-size: 22px;
        line-height: 20px;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div class="alert">
        <span class="closebtn" onClick="window.frameElement.parentElement.style.display='none';">&times;</span>
            Ação
    </div>
  </body>
</html>
    
09.06.2017 / 19:23