2
Talk personal, I have an image zoom problem and hide the caption itself, in the image’s Hover I increase its scale in css, already in jquery I hide the caption, but when scaling, the images next to is over already tried to change the z-index but it didn’t work and when a caption of an image goes missing, all the others are also hidden, someone helps?
<?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:
Thanks!!! I forgot I could use the display:None in Hover, I even do it in Nav sub-menu, thanks, gave it right!
– JASL
@JASL that there! Not always the jQuery is the best solution, mainly for simple cases like this. Good luck there in the project!
– hugocsl