• Resolved ll2pakll

    (@ll2pakll)


    Hi. I’m trying to make the borders of the sliders on my site rounded. To do this, I added this code to the additional styles on my site

    .metaslider {
        border-radius: 30px;
    }

    But this code doesn’t change the appearance of the sliders. What am I doing wrong?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ll2pakll

    (@ll2pakll)

    Through trial and error, I found the right selector. But this selector allows to select each slider separately, because the class name for each slide includes the slider id number. Is it possible to assign one class to all slides? (Assigning a class in Developer Options doesn’t help, I’ve tried it).

    .slider-51 {
    border-radius:61px
    }
    Thread Starter ll2pakll

    (@ll2pakll)

    It worked when I wrote the JavaScript. Maybe someone could use it.

    document.addEventListener('DOMContentLoaded', () => {
    // Select all elements
    const allElements = document.querySelectorAll('*');

    // Define the regex pattern for class names starting with "slider-" followed by a number
    const sliderClassPattern = /^slider-\d+$/;

    // Loop through each element and check if any class name matches the pattern
    allElements.forEach(element => {
    element.classList.forEach(className => {
    if (sliderClassPattern.test(className)) {
    // Set the border-radius property
    element.style.borderRadius = '61px';
    }
    });
    });
    });
    Plugin Author htmgarcia

    (@htmgarcia)

    Hi @ll2pakll

    in cases like this we would recommend this selector, where 123 needs to be replaced with the actual slideshow ID:

    #metaslider-id-123 ul.slides > li {

    }

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.