Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 9d 05h 25m 18s
Claim 50% off
Staff replied SP Page Builder Joomla 6 v6.10.0

Dynamic Content Carousel – Centre Active Slide and Hover Styling

Asked by Samuel Desloges 1 month ago Last activity 1 month ago

Hello JoomShaper Team,

I'm currently testing the Dynamic Content Collection Carousel in SP Page Builder Pro.

What I'm trying to achieve

I'm using a Dynamic Content Collection in Carousel mode, with five slides visible simultaneously. I would like to customise the visual behaviour of each slide depending on its state.

Ideally, I would like the following three states:

  • Normal: the slide displays only its image.
  • Hover: a border, title, description and button appear over the image, with a smooth transition.
  • Active: the centre slide automatically displays the same elements without requiring hover.

As the carousel moves, the Active state should automatically follow the new centre slide.

This behaviour should work with autoplay, manual navigation, looping and responsive layouts.

What I've tried

I've explored the available Dynamic Content Collection settings and experimented with custom CSS.

However, I haven't found a built-in option to automatically identify the centre slide or independently control the appearance and visibility of its dynamic content elements.

I'm also using a third-party template that provides a similar effect through a Swiper-based carousel. I would like to achieve this behaviour using SP Page Builder's native functionality.

Test page

You can view my test page directly here:

https://caplangues.lu/v2027/fr/component/sppagebuilder/page/97.html

Please look at the "NOS SOLUTIONS" section, which contains the Dynamic Content Collection Carousel I'm currently configuring.

The page is still under development, and the content used in this carousel is temporary. The desired behaviour has therefore not yet been achieved, particularly the automatic highlighting of the centre slide and the hover effects.

The page is currently available in French only, but this should not prevent you from examining the carousel's structure and behaviour.

Please note that my enquiry relates exclusively to SP Page Builder Pro's native functionality, not to the third-party template itself.

My questions

  1. Is there already a built-in feature or recommended method to achieve this behaviour with the Dynamic Content Collection Carousel?
  2. If not, would you consider introducing Normal / Hover / Active slide styling, including automatic identification of the centre slide, in a future update?

Ideally, this feature would allow users to customise borders, backgrounds, transitions and the visibility of individual dynamic content elements (title, description, button, etc.) according to each slide's state.

I'm particularly interested in a native, maintainable solution that remains compatible with future Joomla and SP Page Builder updates, without relying on custom JavaScript tied to the carousel's internal structure.

I believe this improvement could also be useful to many other users when showcasing services, products, projects or portfolios.

Thank you in advance for your assistance and for considering this suggestion.

Kind regards.

2 replies

Toufiq Senior Staff

Hi there,

Thanks for contacting us. Sorry, right now this feature/functionality is not available. But we will try to considering it for future update.

But, you can use this solution using custom css & js code. But, it can be conflict other scripts.

CSS

ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
.sppb-dynamic-content-collection__item {
    position: relative;
    overflow: hidden;
}


ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
.sppb-dynamic-content-collection__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
.cap-solution-cartouche {
    position: absolute;
    inset: 0;
    z-index: 10;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid transparent;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        border-color 0.3s ease,
        visibility 0.3s ease;
}


ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
li:hover .cap-solution-cartouche,


ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
li.is-center .cap-solution-cartouche {
    opacity: 1;
    visibility: visible;
    border-color: #fff;
}

ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
li:hover .cap-solution-cartouche,
ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]
li.is-center .cap-solution-cartouche {
    pointer-events: auto;
}

JS

(() => {
    const selector =
        'ul[data-addon-id="741d6893-5850-4157-b575-620651aea86c"]';

    function initializeCenterDetection() {
        const slider = document.querySelector(selector);

        if (!slider) return;

        const viewport = slider.closest('.bx-viewport');

        if (!viewport) return;

        function updateCenterSlide() {
            const slides = [...slider.querySelectorAll('li')];

            if (!slides.length) return;

            const viewportRect = viewport.getBoundingClientRect();
            const viewportCenter =
                viewportRect.left + viewportRect.width / 2;

            let centerSlide = null;
            let smallestDistance = Infinity;

            slides.forEach((slide) => {
                const rect = slide.getBoundingClientRect();

                if (
                    rect.right <= viewportRect.left ||
                    rect.left >= viewportRect.right
                ) {
                    slide.classList.remove('is-center');
                    return;
                }

                const slideCenter = rect.left + rect.width / 2;
                const distance = Math.abs(
                    slideCenter - viewportCenter
                );

                if (distance < smallestDistance) {
                    smallestDistance = distance;
                    centerSlide = slide;
                }

                slide.classList.remove('is-center');
            });

            if (centerSlide) {
                centerSlide.classList.add('is-center');
            }
        }

        const observer = new MutationObserver(updateCenterSlide);

        observer.observe(slider, {
            attributes: true,
            attributeFilter: ['style']
        });

        window.addEventListener('resize', updateCenterSlide);

        updateCenterSlide();

        requestAnimationFrame(updateCenterSlide);
        setTimeout(updateCenterSlide, 300);
        setTimeout(updateCenterSlide, 800);
    }

    if (document.readyState === 'loading') {
        document.addEventListener(
            'DOMContentLoaded',
            initializeCenterDetection,
            { once: true }
        );
    } else {
        initializeCenterDetection();
    }
})();

-Thanks

Samuel Desloges Asked this

Hi Toufiq,

Thank you for your detailed reply and for the proposed workaround.

To show you exactly what I would like to achieve, please have a look at the "Nos solutions" section, titled "Construisons votre formation selon vos priorités", on this page:

https://caplangues.lu/v2027/fr/component/sppagebuilder/page/98.html

This is the original carousel from the Bizper template, which I have simply customized with my own text and images.

Ideally, I would like to reproduce this exact layout, styling and behaviour using SP Page Builder's Dynamic Content feature, as it would make managing and updating the carousel's content much easier directly through collections.

However, I would prefer to wait until this becomes possible natively within SP Page Builder, rather than relying on custom CSS, JavaScript or other workarounds.

My priority is to keep the website easy to maintain and fully compatible with future updates.

I therefore hope this functionality can be considered for a future SP Page Builder release.

Thank you again for your help and support!

Toufiq Senior Staff

Thank you for your detailed feedback. I will share your information with our development team. Once I receive their feedback, I will let you know. Thanks

Log in to reply.