0
I have a Javascript/Jquery method that updates a Partialview and inside it there is a div with a fadeToggle
associated.
Javascript in Onload (to associate Fadetoggle) (Works)
$("#ComentarioAba").click(function () {
$("#Comentario").fadeToggle(500);
});
Javascript method:
function ReloadComentarios() {
$('#Comentarios').empty();
$('#Comentarios').load(document.URL + ' #ComentarioAba');
$("#ComentarioAba").click(function () {
$("#Comentario").fadeToggle(500);
});
}
HTML code
<div id="Comentarios">
<div id="ComentarioAba" class="col-md-12 mwTituloArea">
<p>Comentários </p>
</div>
<div id="Comentario" class="col-md-12">
<div class="col-md-12 ">
...
</div>
</div>
</div>
It happens that after the method ReloadComentarios
is executed, the fadeToggle
doesn’t work anymore. Even though the association is redone within the method itself.
Why does this occur?