Changing color-variable-item.selected
Wed Nov 10 2021 07:03:31 GMT+0000 (Coordinated Universal Time)
Saved by
@itaiki
/* color-variable-item.selected*/
add_action( 'wp_footer', 'custom_scripts' );
function custom_scripts() {
?>
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery('.rey-quickviewPanel').on('DOMSubtreeModified', function () {
setTimeout(function() {
console.log('===data color: ' + jQuery('.color-variable-item.selected .variable-item-span').attr('data-color'));
jQuery('.color-variable-item .variable-item-span').css("background-color","transparent");
jQuery('.color-variable-item.selected .variable-item-span').css("background-color",jQuery('.color-variable-item.selected .variable-item-span').attr('data-color'));
}, 10);
});
jQuery('#pa_colors').on('DOMSubtreeModified', function () {
setTimeout(function() {
console.log('data color: ' + jQuery('.color-variable-item.selected .variable-item-span').attr('data-color'));
jQuery('.color-variable-item .variable-item-span').css("background-color","transparent");
jQuery('.color-variable-item.selected .variable-item-span').css("background-color",jQuery('.color-variable-item.selected .variable-item-span').attr('data-color'));
}, 10);
});
});
</script>
<?php } ?>
content_copyCOPY
https://itdesign.co.il
Comments