I have a problem with image zoom and hide the caption of my own, in the hover of the image I increase the scale of it in the css, already in the jquery I hide the legend, but when climbing, the images next to it I already tried to change the z-index but it did not work and when a caption of an image disappears, all the others are also hidden, does anyone help?
<?php
$Read = new Read;
$Read->ExeRead("ws_categories_product", "WHERE category_parent = '1'");
foreach ($Read->getResult() as $v) {
extract($v);
?>
<section class="content section-product">
<header class="section_header_product">
<h2><?= $category_title; ?></h2>
<p class="tagline">
<?= $category_content; ?>
</p>
</header>
<div class="article-img-product">
<?php
$Read->ExeRead("ws_product", "WHERE post_category = :id", "id={$category_id}");
foreach ($Read->getResult() as $value) {
?>
<article>
<figure class="figure-product">
<img class="img-product" alt="<?= $value['post_title']; ?>" title="<?= $value['post_title']; ?>" src="<?= HOME; ?>/tim.php?src=<?= HOME; ?>/adm/uploads/<?= $value['post_cover']; ?>&w=460&h=300" />
<figcaption class="fig-img">
<span>
<?= $value['post_title']; ?>
</span>
<p class="figure-p">
<?= $value['post_content']; ?>
</p>
</figcaption>
</figure>
</article>
<?php
}
?>
</div>
</section>
<?php
}
?>
CSS:
.article-img-product {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.article-img-product article {
padding: 5px;
width: 25%;
/* z-index: -1; */
}
.figure-product {
position: relative;
}
.img-product {
-webkit-transition: all 200ms ease-in;
-webkit-transform: scale(1);
-ms-transition: all 200ms ease-in;
-ms-transform: scale(1);
-moz-transition: all 200ms ease-in;
-moz-transform: scale(1);
transition: all 200ms ease-in;
transform: scale(1);
z-index: -1;
opacity: 0.9;
}
.img-product:hover {
transform: scale(1.5);
z-index: 9999;
opacity: 1;
/* border: 5px solid transparent; */
}
JQUERY:
$('.figure-product').on('mouseover', function () {
$('.fig-img').hide();
});
$('.figure-product').on('mouseout', function () {
$('.fig-img').show();
});
Print1: