Open div when clicking on specific element

0

I made a foreach on my bank plus the code will stay very long continuing, What I want to do is to have the user click on the link to appear a confirmation of a div, this div will have a link to actually delete the article the problem is when I call the commit div, JS calls several divs, I would like the commit div to appear in the clicked element

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
    $("document").ready(function(){ 
        $('.excluir').click(function(){
            $('.janela-moldal').fadeIn();
         });

        $('.chamar-moldal').click(function(){
            $('.janela-moldal').fadeIn();
        });

        $('.cancelar').click(function(){
            $('.janela-moldal').fadeOut();
        });

        $(".excluir-artigo").live('click',function(){
             $.post('php/deletar.php', {coment:$(this).attr('id')});
             $(this).parent('div').fadeOut();
             $(".janela-moldal").fadeOut();
        };
    });
});
</script>

<?php
    $artigo[] = array();
    $artigo['artigo_id'] = 1;
    $artigo['frase'] = '"A vingança nunca é plena, mata a alma e a invenena"';

    var_dump($artigo);
?>

  <div class="artigos" id="artigos"> 
      <?=$artigo['artigo_id']; ?>
      <h1><?= $artigo['frase']; ?></h1>
      <a class="chamar-moldal" href="javascript:void(0);">chamar a div de confirmacão </a>
  </div>

   <div class="janela-moldal" style="display:none"> 
       <h1>Deseja excluir este artigo?</h1>
            <a class="cancelar" href="javascript:void(0);">cancelar</a>
            <a class="excluir-artigo" id="artigo-<?=$artigo['artigo_id']?>" href="javascript:void(0);">excluir</a>
   </div>       
    
asked by anonymous 08.01.2016 / 18:54

1 answer

-1

If you can, use the Bootstrap Small Modal .

It's elegant, and very simple to implement.

    
08.01.2016 / 19:00