ACF Fields' Visibility on Vendor Dashboards
JavaScript Solutiondemironmanx
javascript
a year ago
1.0 kB
31
No Index
document.addEventListener("DOMContentLoaded", function() {
setTimeout(function() {
// Select the container that holds the fields
var formFields = document.querySelector('.marketking_card_gal_cat_tags .acf-form-fields');
if (formFields) {
// Apply flexbox to the container
formFields.style.display = 'flex';
formFields.style.flexWrap = 'wrap'; // Allows wrapping to the next line
}
// Apply styles to each field
var fields = document.querySelectorAll('.marketking_card_gal_cat_tags .acf-field');
fields.forEach(function(field) {
field.style.width = '25%'; // Each field takes up 25% of the width
field.style.paddingRight = '10px'; // Adds padding between the columns
field.style.boxSizing = 'border-box'; // Includes padding in the width calculation
field.style.marginBottom = '15px'; // Adds margin at the bottom
});
}, 1000); // Adjust the timeout as needed
});Editor is loading...
Leave a Comment