Hover Effect on Mobile not working properly

Hello, i wanted the second picture to show when hovered on mobile

I added this code in component-card.css and base.css

This helped a little but there was still an issue which you can see in the video below

This almost fixed the issue as its working on the Home Page(featured collection) and “You May Also Like” Section however as you can see in the video, its not properly working on the collection pages.

I have enabled the hover option in collection pages but it is not working properly.

Please Help me out. I have been stuck with this problem for 3 whole days and its frustrating me.

URL:thoughtbox-pk.myshopify.com

PW:shopify123

HI @saadrafi ,

Hi,

Try the following code below.

  1. From your Admin Page, click Online Store > Themes >Actions > Edit code
  2. In the Asset folder, open the base.css
  3. Please find this code in your base.css and replace this with the code below.

You are missing some bracket on you code. That is the reason the code in the base.css does not work (see image below)

@media screen and (max-width: 749px) {
	.banner__content::before{
		padding-bottom: 180.5% !important; 
    }
}

 @media screen and (max-width: 481px) {
  .card .media.media--hover-effect > img:only-child,
  .card-wrapper .media.media--hover-effect > img:only-child {
    transition: transform var(--duration-long) ease;
  }

  .card:hover .media.media--hover-effect > img:first-child:only-child,
  .card-wrapper:hover .media.media--hover-effect > img:first-child:only-child {
    transform: scale(1.03);
  }

  .card-wrapper:hover
    .media.media--hover-effect
    > img:first-child:not(:only-child) {
    opacity: 0;
  }

  .card-wrapper:hover .media.media--hover-effect > img + img {
    opacity: 1;
    transition: transform var(--duration-long) ease;
    transform: scale(1.03);
  }
}

I added the bracket here but still no luck. its not working as intended. please help me

@made4Uo kindly help

@KetanKumar

@LitCommerce

@saadrafi

oh sorry for that issue

but sorry mobile device doesn’t possible hover bcz mobile device hover convert to touch

please watch the video. its working on home page but not on collection pages

@saadrafi

sorry but on click mobile device not hover work only touch event work

ok how can i make touch event work on collection like its working on home page

please see the video before giving a solution so we understand what the issue is

https://www.youtube.com/watch?v=EcL7WxTqjog&feature=emb_title

@saadrafi Did you ever get this figured out?

@melsonweb no sorry mobile device it work on touch event that good idea to work also may be just remove your link