• Resolved Uwe Jacobs

    (@uwejacobs)


    There seems to be something off with the auto-scroll for carousels. As far as I understand the Bootstrap 5 documentation, the data option bs-ride=”carousel” has to be set at the div with class “carousel” in order for it to auto-scroll on page load.

    Then I looked at the source code and found this snippet in wp-content/plugins/all-bootstrap-blocks/blocks/carousel/block.js at line 85:

    <areoi.components.PanelRow className="areoi-panel-row">
    <areoi.components.ToggleControl
       label={ 'Auto Scroll' }
       help="Set to true if you want the carousel to automatically scroll between slides."
       checked={ attributes.interval }
       onChange={ ( value ) => onChange( 'interval', value ) }
    />

    It seems odd that the auto-scroll refers to the interval, which is set at the carousel item.

    • This topic was modified 2 years, 5 months ago by Uwe Jacobs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Miles

    (@areoimiles)

    Hi @uwejacobs

    Thank you for taking the time to flag this issue. It’s definitely something I can look to resolve. I think the best approach is to add the bs-ride attribute as you have suggested and then create an additional field so you can set the interval. I will look to resolve this on the next release.

    In the meantime, so that I don’t slow down your development you could override the default carousel template. You can learn how to do this here https://areoi.io/all-bootstrap-blocks/documentation/getting-started/overriding-block-templates/

    If you copy the carousel.php block into your theme, towards the bottom of the file you will see $output… this is where you will need to add the bs-ride attribute.

    I hope this helps for the time being and I will send you an update as soon as I have resolved the issue. Thanks again for making us aware.

    Thanks

    Miles

    Thread Starter Uwe Jacobs

    (@uwejacobs)

    Thanks Miles. Since I want all my carousels to slide automatically, I added this small piece of javacode code for now:

    jQuery(document).ready(function() {
    	jQuery(".carousel").carousel("cycle");
    });
    Plugin Author Miles

    (@areoimiles)

    Morning @uwejacobs

    I have just released an update that should resolve this issue. You are now able to turn auto scroll on and off as well as being able to change the interval time between slides.

    Hopefully this works as you expected, but if you have any issues please don’t hesitate to get back in touch. Thanks again for taking the time to inform us of this issue.

    Miles

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t get Carousel Auto Scroll to work’ is closed to new replies.