Php:
<?php foreach($products as $index => $product): ?>
echo '<div class="product-popup" data-popup="<?=$index?>"><?=$product->description; ?></div>';
<?php endforeach; ?>
Js:
<script>
$(".product").on("click", function(e){
var div = $(this);
$("#modal-content").load(div.attr("/products/detail?id=" + div.attr("data-popup")));
$("#modal-div").modal("show");
}):
</script>
Html:
<div id="modal-div" class="modal in" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div id="modal-content"></div>
</div>
</div>
</div>
</div>