I think it's a question of putting the code in the right place, but I'm breaking my head and I can not ...
I tested the default BootStrap code, where it works on a button. I even put the data calls inside it and it worked.
The question now is, my index returns values from the database by while:
while ($posts = mysql_fetch_array($busca)){
extract($posts);
?>
<div class="col-md-2" >
<div class="item-title">
<h6 class="title">
<strong>
<a href="single.php?id=<?php echo $posts['id']?>" title="<?php echo $posts['titulo']; ?>" >
<?php echo $posts['titulo']; ?></a>
<strong>
</h6>
</div><!--Fecha titulo do posts/item-->
<div class="item-img" data-toggle="modal" data-target=".bs-example-modal-lg">
<a href="single.php?id=<?php echo $posts['id']?>" title="<?php echo $posts['titulo']; ?>" class="thumbnail">
<img src="uploads/<?php echo $posts['path'] ?>" title="<?php echo $posts['titulo']; ?>" alt="" id="blc-img" />
</a>
</div><!--Fecha Imagem do posts/item-->
<div class="item-vist">
<h6 class="vist"><small>Visitas <b><?php echo $posts['visitas'] ?></small></b></h6>
</div><!--Fecha Visitas do posts/item-->
</div>
<?php
};
?>
How can I adapt this code so that when I click on one of the items, it opens in Modal, not in single.php? how are you at the moment?
Mod code: '
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg">
<div class="modal-content">
...
</div>
</div>
</div>'
I will not modify the default Modal code (I believe there is no need). I would like that when you click on one of the returned items, it opens in Modal.
Modal with button in operation:
My idea is when you click on the post (the one below the Catalog), it opens the same way as the button.
Thank you in advance!