Add class to class .flex-viewport
-
I have successfully added class .c to class .woocommerce-product-gallery__wrapper and class .d to class .woocommerce-product-gallery__image but I cannot add 2 classes .a and .b to class .flex-viewport. Here is the code I used. How can I add any 2 classes along with .flex-viewport class using javascript
add_action('wp_footer','test',99); function test(){ if ( is_product() ) { ?> <script> jQuery(document).ready(function( $ ){ jQuery('.flex-viewport').addClass('a b'); jQuery('.woocommerce-product-gallery__wrapper').addClass('c'); jQuery('.woocommerce-product-gallery__image').addClass('d'); }); </script> <?php } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add class to class .flex-viewport’ is closed to new replies.