Dear Sirs,
I have a div that is populated via ajax:
function atualizaConteudo(){
$.ajax({
url: 'getters/conteudo_amanha.php',
success: function(data) {
$('#conteudo_amanha').html(data);
}
});
}
atualizaConteudo();
The div looks like this:
<div id="conteudo_amanha">
<button type="button" class="novo-detalhe" data-id_conteudo="4">
Mostrar conteudos
</button>
<div id="conteudo_4" style="display: none">
Conteudos recuperados
</div>
</div>
I try to make slideToggle ():
$('.novo-detalhe').on('click',function(){
var id_conteudo= $(this).data('id_conteudo');
$('#conteudo_'+id_conteudo).slideToggle();
});
I need the div retrieved via ajax (#content_4), is hidden / shown when the user clicks the button, I put the div inside the page (instead of using ajax to insert inside div # conteudo_amorrow), it worked , but I am not able to make it work using the ajax request.
I'm new with ajax and jquery ...