Add to cart – show poppup

0.0/5
<?php
add_action('wp_footer', 'trigger_myscript_add_to_cart');
function trigger_myscript_add_to_cart() {
?>
<script type="text/javascript">

jQuery(document).ready(function () {
	jQuery('.jet-blocks-cart__list').css({ opacity: '0', top: '-999em' });
});

jQuery('.add_to_cart_button').on('click', function () {
	jQuery('.jet-blocks-cart__list').css({ opacity: '1', top: '1em' });
});

jQuery(document).mouseup(function (e) {
	var popup = jQuery(".jet-blocks-cart__list")
	if (!jQuery('.add_to_cart_button').is(e.target) && !popup.is(e.target) && popup.has(e.target).length == 0) {
		popup.css({ opacity: '0', top: '-999em' });
	}
});
</script>
<?php }

Comments and reviews

{{ reviewsTotal }} Review
{{ reviewsTotal }} Reviews
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}

Description

This snippet was fetched automatically from WPDistro.cz projects.

Author

Tags

This snippet is untagged