Hey there, I'm currently working on a Shopify website and trying to make the hamburger menu change to a cross when clicked. I've been experimenting with different methods, but unfortunately haven't had any success so far. I have two images – one for the hamburger icon and another for the cross, each assigned to a separate class.
Site URL:"https://9q49gu54zvkaspm1-18691129395.shopifypreview.com/"
I would really appreciate some assistance on this matter.
if($('body').hasClass(".show-mobile-nav"))
{
$('img.close').hide();
}
else($('body').hasClass(""))
{
$("img.open").show();
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Here is the code snippet that I have attempted: