How do I when I click on the checkbox
it dynamically marks an image with border. I'm trying to do it but it always marks all img
how could I do that. Note: my img
comes from the bank everything is dynamic.
dynamic part php
:
<div class="btn-group" data-toggle="buttons">
<label class="check btn btn-primary">
<input type="checkbox" name="ck[]" value="$imagem" id="$id"> Selecionar
</label>
<div>
part of jquery
$(".check").click(function(){
$("img").toggleClass('clic');
});
obs. with this code I can mark the img
but all and not and that what I want I wanted to mark only the ones that I click. example, and I click on the first img
mark only it and then if I mark the fifth img
mark only it. in the end I will have 2 marked that I chose img
1 and 5
full php code:
require"sys/conexao.php";
$nome = $_GET['noivos'];
$nomeurl = $_GET['noivos'];
$sql = mysqli_query($mysqli, "SELECT * FROM galeria WHERE email = '$nome'");
while($aux = mysqli_fetch_assoc($sql)){
$titulo = $aux['nome_galeria'];
$imagem = $aux['img'];
$img_big = $aux['img_big'];
$id = $aux['id'];
$_SESSION['id'] = $id;
print"
<div class=\"col-lg-3 col-md-4 col-sm-6 col-xs-12\">
<div class=\"hovereffect\">
<img class=\"img-responsive\" src=\"images/small/selecao/$imagem\" alt=\"\">
<div class=\"overlay\">
<div class=\"pad\">
<h2>$titulo</h2>
<a class=\"info test-popup-link\" href=\"images/big/selecao/$img_big\"><span class=\"corr\"><i class=\"fa fa-search\"></i></span></a>
<div class=\"btn-group\" data-toggle=\"buttons\">
<label class=\"check btn btn-primary\">
<input type=\"checkbox\" name=\"ck[]\" value=\"$imagem\" id=\"$id\"> Selecionar
</label>
</div>
</div>
</div>
</div>
</div>";
}
mysqli_close($mysqli);