I'm having an issue with a hover effect implemented on a website. The effect works fine on desktop. On mobile, the images all appear normally and when I click on the they take me to the correct link. But when I press back on the browser, all I'm seeing is the images alt text. Could someone advise? Here's the code I currently have. I can't seem to find any solutions on here for a similar issue. Thank you
$(document).ready(function () {
$('.img1')
.mouseover(function () {
$(this).attr("src", "https://cdn.shopify.com/s/files/1/1297/5789/t/3/assets/Easy_Motion_-_Electric_Bicycles_Two.jpg?6314974642385151026");
})
.mouseout(function () {
$(this).attr("src", "https://cdn.shopify.com/s/files/1/1297/5789/t/3/assets/Easy_Motion_-Electric_Bikes.jpg?10135819641956685452");
});
<div class='desktop-4 tablet-full mobile-full'><a href='/home'><img src="https://cdn.shopify.com/s/files/1/1297/5789/t/3/assets/Easy_Motion_-Electric_Bikes.jpg?10135819641956685452" alt="electric bikes by easy motion" class="img1"/></a></div>