Last active
December 28, 2021 06:52
-
-
Save xlplugins/58c80a6aebdde4db5f50fe123c21c940 to your computer and use it in GitHub Desktop.
Collapsible order summary on mobile open on first load and then can close on click
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( 'wfacp_internal_css', 'exute_custom_aero_js' ); | |
function exute_custom_aero_js() { | |
?> | |
<style> | |
@media (min-width: 992px)and (max-width: 1366px) { | |
.wfacp_collapsible_order_summary_wrap.wfacp_tablet.wfacp_mobile { | |
display: none; | |
} | |
} | |
</style> | |
<script> | |
window.addEventListener('DOMContentLoaded', function () { | |
(function ($) { | |
var width = $(window).width(); | |
collpaseOrderSummary(width); | |
$(window).on("orientationchange", function () { | |
setTimeout(function () { | |
var width = $(window).width(); | |
collpaseOrderSummary(width); | |
}, 500); | |
}); | |
function collpaseOrderSummary(width) { | |
$('.wfacp_mb_mini_cart_sec_accordion_content').addClass('wfacp_display_none'); | |
console.log(width); | |
if (width <= 768 ) { | |
if ($('.wfacp_mb_mini_cart_sec_accordion_content').length > 0) { | |
$('.wfacp_mb_mini_cart_sec_accordion_content').removeClass('wfacp_display_none'); | |
} | |
} | |
} | |
})(jQuery); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment