Created
April 26, 2024 11:36
-
-
Save xlplugins/3ec21e4a2ac290a486812a83fb74e352 to your computer and use it in GitHub Desktop.
Funnelkit Cart: Add or remove class when funnelkit cart open or closed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_footer',function (){ | |
?> | |
<script> | |
window.addEventListener('load', function () { | |
jQuery(document.body).on('fkcart_cart_open',function(){ | |
if(jQuery('body').hasClass('mm-wrapper--position-left')){ | |
jQuery('body').removeClass('mm-wrapper--position-left') | |
} | |
}); | |
jQuery(document.body).on('fkcart_cart_closed',function(){ | |
if(!jQuery('body').hasClass('mm-wrapper--position-left')){ | |
jQuery('body').addClass('mm-wrapper--position-left') | |
} | |
}); | |
}); | |
</script> | |
<?php | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment