Author Topic: Rollover image on Category View  (Read 4874 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4518
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Rollover image on Category View
« Reply #15 on: July 24, 2019, 12:45:51 pm »
AH, you are right, all information has already been given. Farketmez99, please do some effort or pay someone to do it for you.

shenlong2210

  • Beginner
  • *
  • Posts: 12
Re: Rollover image on Category View
« Reply #16 on: August 11, 2021, 10:27:53 am »
default.php
<div class="spacer vm-product-media-container">
               <?php
               if (!empty($product->images[0])) {
                  $image = $product->images[0]->displayMediaThumb ('class="featuredProductImage"', FALSE);
                   if(isset(self::$product->images[1])){
                  echo $product->images[1]->displayMediaThumb('class="featuredProductImage secondIMG"', false);
                  }
                  else { echo $product->images[0]->displayMediaThumb('class="featuredProductImage secondIMG"', false);}
               } else {
                  $image = '';
               }

CSS
/* shenlong2210 - CHỈNH 02 ẢNH THÀNH 1 CHO HOVER MOUSE */
         .vm-product-media-container{
            position: relative;
            display: inline-block;
         }
         .vm-product-media-container .secondIMG {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
         }
         .vm-product-media-container:hover .secondIMG {
            display: inline;
         }