1
I have a page, where it displays dynamic content using the load()
. How to apply the effect slideDown()
when document is displayed on page?
My code is like this:
index php.
<div class="col-md-3">
<div class="panel panel-primary">
<div class="panel-heading">
Documentos
</div>
<div class="panel-body">
<div class="list-group">
<a href="#" class="list-group-item" data-page="2" title="Todos">Todos</a>
<a href="#" class="list-group-item" id="nread" data-page="0" title="Não lidos">Não lidos<span class="badge"><?php echo $new_doc ?></span></a>
<a href="#" class="list-group-item" data-page="1" title="Lidos">Lidos</a>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="panel panel-primary">
<div class="panel-heading">
<span id="page-title">Todos</span>
</div>
<div class="panel-body">
<table class="table table-bordered">
<thead>
<tr>
<th>Enviado em</th>
<th>Documento</th>
<th>Vencimento</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
Showfiles.js
$('.list-group a').click(function() {
$('tbody').load('view/read.php', function() {
$(this).slideDown();
});
$('.list-group-item').removeClass('active');
$(this).addClass('active');
$('#page-title').html(title_page);
}
read php.
<tr>
<td class="1">03/09/2014 14:32:55</td>
<td>Nome do documento</td>
<td>10/09/2014</td>
<td>
<?php echo "<a href='view/showFile.php?token=" . $token . "®=" . $result['reg'] . "' title='Vizualizar' target='_blank' class='btn btn-default view' data-toggle='tooltip' data-placement='top'><span class='glyphicon glyphicon-open'></span></a>" ?>
<span><?php echo "<a href='action/downloadFile.php?token=" . $token . "®=" . $result['reg'] . "' title='Download' class='btn btn-default download' data-toggle='tooltip' data-placement='top'><span class='glyphicon glyphicon-download-alt'></span></a>" ?></span>
</td>
</tr>
Po buddy, it didn’t work :( Is there anything, that can prevent this?
– Meeeefiu
@Mathdesigner47 has an error in the console? Is the content loading well? Can you describe better what does not work?
– Sergio
In the console there is no error, the content is being shown normally with and without this callback. I’ll edit my question by putting my entire code.
– Meeeefiu
@Mathdesigner47, here in Sweden it’s bedtime. If you put your HTML corresponding to the code I (or another one here on the site) can re-create what you have in jsFiddle and show an example working. Maybe then you can see the mistake...
– Sergio
All right, I’ll put it right here
– Meeeefiu