One of the buttons on my website has a hover effect that changes its opacity. This button is used to share information on Facebook.
It's a simple feature to implement.
Here is the CSS code:
.social_vk, .social_fb {
height: 38px;
object-fit: contain;
cursor : pointer;
opacity: 1;
}
.social_vk:hover, .social_fb:hover {
opacity: 0.7;
}
And here is the HTML code:
<div class="social">
<img src="/images/vk.svg" class="social_share social_vk" data-type="vk" ontouchstart="this.style.opacity = '0.8'" ontouchend ="this.style.opacity = '1'">
<img src="/images/facebook.svg" class="social_share social_fb" data-type="fb" ontouchstart="this.style.opacity = '0.8'" ontouchend="this.style.opacity = '1'">
The issue is when tapping on the button, it opens a modal window for Facebook and the button's opacity remains at 0.8.
I'm not sure how to resolve this problem as I seem to be stuck here.