25th Nov '22
/
2 comments

How to Create a Right Overflow Effect on Sliders in Bricks

How to Create a Right Overflow Effect on Sliders in Bricks

In this tutorial, we’ll learn how to recreate a nice overflow effect on the right of our sliders in Bricks.

Table of Contents

Introduction

Recently, I’ve been asked to create a tutorial on how to add the pretty popular overflow effect on sliders, but only on the right – and keep the left of the slider boxed.

There are different ways to achieve it. I’ll list two methods here: one using the looping slider and one without the loop.

Let’s see how we can implement it using only a few lines of CSS.

Set the section’s overflow

First of all, make sure that the section that contains the slider element has overflow set to hidden:

The slider settings

Let’s add the class .slider-right-overflow to our slider:

Non-looping sliders

Set the slider type to slide:

The slider is looking as expected on frontend:

But when we slide it, the overflow on the left won’t be applied:

If you are fine with that, jump on the CSS section. Otherwise check the second method.

Looping sliders

Set the slider type to Loop:

Then add a :before pseudo-element to the same element (the slider container, not the slides), and add the following layout settings:

And finally, add the same background color of your section to the pseudo-element (in our case it’s #fff since the section background is white):

Now the left overflow is preserved even when sliding:

The CSS:

Add the following CSS code to your page:

.slider-right-overflow .splide__track {
    overflow: visible;
}

And we are done! Super easy to do for a great result.

Get access to all 624 Bricks code tutorials with BricksLabs Pro

2 comments

Leave your comment

 

Related Tutorials..

How to add a custom SwiperJS slider in Bricks

How to add a custom SwiperJS slider in Bricks

In this tutorial, we'll show you how to integrate a custom slider in Bricks using the SwiperJS library and how to add custom parameters using…
Categories:
Tags:
Pro
Post-specific ACF Repeater Galleries as Sliders in Bricks

Post-specific ACF Repeater Galleries as Sliders in Bricks

How to output ACF Repeater field rows with the images of the Gallery-type sub field as a slider.
Pro
Changing Bricks Lightbox Arrow Icons

Changing Bricks Lightbox Arrow Icons

How to change the left and right arrow svg icons with custom ones in Bricks lightbox.
Categories:
Tags:
Pro
Custom Posts Grid Layout in Bricks using CSS Grid

Custom Posts Grid Layout in Bricks using CSS Grid

There are at least three ways in which we can build custom loops in Bricks. Posts elementTurning on Query Loop on a containerCode element While…
Categories:
Using Automatic.css in Bricks

Using Automatic.css in Bricks

Update on 18 Aug 2022: The info below is not up to date. Follow documentation/videos provided by Automatic.css. Automatic.css is an excellent CSS framework that…
Categories:
Pro
Ken Burns Background Slideshow in Bricks

Ken Burns Background Slideshow in Bricks

Setting up a hero section, having images that pan and move as a background slideshow with content on top.
Categories:
Tags:
Animated Border Hover Effect Buttons

Animated Border Hover Effect Buttons

Here's how can be implemented in HTML/WordPress/Bricks. Step 1 Add this CSS in your child theme's style.css or another appropriate location: Step 2 Add a…
Categories: