I'm trying to loop multiple images in a div called center the image is supposed to be in the div watermarked
Here's my code when looping the images in div center:
@foreach($data as $key)
<div id="center">
$image_file = $key->album['0']->image;
</div>
@endforeach
The codes when inserting a watermark on the image to be diplayed in the div center:
var image_file = '<?php echo asset($image_file) ?>';
watermark([image_file, 'http://localhost:8080/uploads/product/watermark.jpg'])
.image(watermark.image.center(0.5))
.then(function (img) {
document.getElementById("center").appendChild(img);
});
but when i do that, all the images come in the same div center, instead of being multiple images in multiple center divs
Here is a screenshot of how it is diplayed versus how it should be displayed
How it should be diplayed(picture with its respective details)
Any help would be appreciated. thanks!