I am looking for a way to determine with JavaScript / jQuery if the WooCommerce store notice is displayed. The HTML for the store notice looks like this...
<p class="woocommerce-store-notice demo_store" style="display: block;">
This is a store notice
</p>
I have tried to do this using the following...
jQuery(document).ready(function(){
if ( jQuery('.woocommerce-store-notice').css('display') == 'none') {
console.log('Store Notice Hidden');
} else {
console.log('Store Notice Visible');
}
});
But this is telling me that the notice is hidden everytime, even when it is visible.
Could this be something to do with how the store notice get's displayed? Maybe it get's set after the dom has loaded?