Greetings!
I'm having a problem showing a set of records using jQuery. When I click in the designated link, the script only shows the first record that comes from the database. Am I doing something wrong?
Here's the code
jQuery
$(document).ready(function() {
//hides the slickbox as soon as the DOM is ready
$('div.contentor_imagens').hide();
//shows the slickbox on clicking the noted link
});
function showEtiq(whichDiv) {
showThis = "#contentor_imagens" + whichDiv;
$(document).ready(function() {
$(showThis).toggle("slow");
});
}
HTML/PHP
echo'<div class="contentor_upload_galeria" >
<div class="img_port_options" id="img_port_options'.$id.'">
<a onclick="showSup('.$id.')"><div class="img_manage_up"></div></a>
<div class="img_manage_mup"></div>
<a onclick="showEtiq('.$id.')"><div class="img_manage_edit"></div></a> //DIV THAT IS CLICKED TO TRIGGER THE FUNCTION
</div>
/*
DATABASE QUERY STUFF HERE...
*/
//BLOCK TO BE SHOWN. IT ONLY SHOWS THE FIRST RECORD COMING FROM DB
echo'<div class="etiquetas_imagens" id="contentor_imagens'.$id.'">
<div class="titulo_etiq_imagem">'.$row2['descricao'].'</div>
<div class="botoes_comando">
<a href="#"><div class="visualiza" id="visualiza"></div></a>
<a href="view.php?id='.$row2['ID'].'"><div class="edita"></div></a>
<a href="../crud/delete.php?id='.$row2['ID'].'&mod='.$table.'"><div class="elimina" id="delete"></div></a>
</div>
<div class="contentor_visualiza" id="contentor_visualiza'.$id.'">
<img src="'.$row2['caminho'].'" title="'.$row2['descricao'].'"></img>
</div>
</div>';
Thanks in advance for all the help!
Cheers!