I want to enhance user experience by adding a blue rectangle with a :focus
class when a product is clicked on before the next page loads.
To achieve this, I implemented jQuery functionality that changes the class of the clicked product and adds a new class with a box shadow effect.
However, I'm facing an issue as this feature only seems to work on desktop devices and not on mobile devices.
$(document).ready(function() {
$('div.product-container').on('click', function() {
$(this).addClass('aftertap');
});
});
.aftertap {
-webkit-box-shadow: 0px 0px 12px 3px rgba(113, 129, 194, 1) !important;
-moz-box-shadow: 0px 0px 12px 3px rgba(113, 129, 194, 1) !important;
box-shadow: 0px 0px 12px 3px rgba(113, 129, 194, 1) !important;
}
<div class="product-container style1 clearfix" itemscope="" itemtype="http://schema.org/Product">
<div class="left-block">
<div class="product-image-container">
<a class="product_img_link" href="http://localhost/prestawebserver/forward/102-cropped-leggings-performance-cotton.html" title="Cropped Leggings - Performance Cotton" itemprop="url">
<img class=" img-responsive" src="http://localhost/prestawebserver/1065-home_default/cropped-leggings-performance-cotton.jpg" alt="cropped-leggings-performance-cotton" title="cropped-leggings-performance-cotton" itemprop="image">
</a>
</div>
</div>