Issue with Flickity Slider persisting as it keeps scrolling even after reaching the last slide due to extra

While using the Flickity slider, I encountered an issue where the slider behaves perfectly until after sliding, it shifts too far to the left, leaving a significant amount of blank space behind. Upon inspecting the code, I couldn't find any apparent issues. Could this be due to incorrect slider settings?

<div class='carousel-section'>
  <div class='carousel-wrapper'>
    <h2>Some Clients About us</h2><color:red>
     <!-- Multiple carousel-cell blocks with client testimonials -->
    </div>
  </div>
</div>

CSS:

.carousel-section {
  width:100%;
  height:90vh;
  font-family:'Montserrat', sans-serif;
   /* Remaining CSS styles */
}

/* Additional CSS styles for carousel elements */

The code is based on a CMS system and utilizes modules. The Flickity slider library files (CSS and JavaScript) are also connected to this module by default.

Issue illustration: https://i.sstatic.net/fINYx.png

Upon inspection, it appears that there is excessive empty space on the right side of the slider which disrupts the overall layout. The slider should ideally stop scrolling at a certain point to ensure the slides occupy the entire section without unnecessary spacing. This seems to be the root cause of the problem.

Answer №1

To start Flickity using JavaScript, consider incorporating this setting:

contain: true

Answer №2

To solve this, consider adjusting the width of the container that holds the slider. It is possible that the carousel may be the parent element since Flickity places its buttons within this container. Alternatively, you can constrain the size of the carousel container using your preferred positioning method. For example, in CSS Grid, you could use a rule like minmax(100%, 400px).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating a dynamic design with a responsive background image and three columns of engaging content placed on top using Bootstrap

I'm struggling to translate a design mockup into Bootstrap 3.3.6 Here is an image showcasing the concept I am aiming for: https://i.sstatic.net/1jZmh.png The blue background represents an image, with grey text boxes overlaid on top (one of which in ...

Setting Image Widths for Various Screen Sizes in HTML for Android Tablets and Phones

My android app functions on both tablets and phones, loading content from HTML files in the assets folder. Currently, I am facing an issue where I need different image sizes for tablet and phone devices. Below is the code snippet for displaying the image ...

The selected option in the select dropdown has an erroneous attribute value

Looking to create a select element that displays all the options from an enum and allows for updating a database value based on selection. Here's how it can be achieved: export enum SubscriptionEnum { DAILY= 'DAILY', ANNUAL= 'AN ...

Problem with CSS: The height of the outer div is not being affected by the height of the inner ones

There is a mystery that needs to be solved... I have a basic layout for a webform - header, content, and footer. Inside the content div, I've placed a div intended to hold a flyout menu. However, the content div does not inherit the height of the men ...

Empty Ajax array sent to PHP

I am encountering an issue with my ajax form where the values in an array are coming out as null in my PHP response. I suspect that there may be a mistake in my .ajax call. Can anyone provide suggestions or insights on how to resolve this issue? My code sn ...

Simultaneous activation of two click events in Javascript

I am looking to create a game using JavaScript. The game will be designed for two players to play on the same mobile device. I am facing a challenge with coordinating the players' clicks, as they may happen simultaneously. I have attempted to use bot ...

Issue with CSV download box not showing up on Rails version 2.3.11

I've encountered an issue while trying to export a csv file with some data. I am using ajax call to select rows from the view table (jqGrid) and export them in a csv format. However, after a successful ajax call, the filtered data is displaying as an ...

Utilize external options for Chart.js datasets with added functionality

Exploring Chart.js for the first time in my project, I have found it to be a great tool. However, I've come across a challenge where I need to provide external filter options for the dataset as well. Currently, the filtering is done by clicking on lab ...

What exactly is the significance of status within Google Chrome?

Today, while using Chrome, I encountered something quite unusual. var foo = ["70036", "70374"] var status = ["70036", "70374"] console.log(status[0]); console.log(foo[0]); One would expect the console to display: 70036 70036 However, the actual output ...

Django is experiencing difficulties showcasing static images and loading CSS files

Working with PyCharm 2019.2.5, Python 3.7, and Django 2.2.5, I am in the process of developing a website by importing a template and creating apps for it through Django. However, I am facing issues with the static files not loading properly. Despite runnin ...

The new Facebook login button in my app seems to be glitchy as it fails to redirect users to the appropriate page after

I am working on a web application and have successfully integrated Facebook login from developers.facebook.com. However, I am facing an issue where after the user logs in with their Facebook credentials, they are not redirected to my application. Additiona ...

Protractor struggles to locate mobile values in the HTML DOM despite Selenium's capabilities

I recently encountered an issue while attempting to scrape data for mobile test cases. The code snippet below works flawlessly for desktop, but on mobile it fails to find the desired element (resulting in an empty console log). Interestingly, when I print ...

Modify HTML text using conditional CSS without JavaScript

Apologies for asking such a beginner question, but I've searched high and low for a similar post, to no avail. Here's my query: I have a paragraph text in my HTML code that I want to automatically replace with new text when I click a specific B ...

Safari users may encounter issues with Web Audio playback in iOS 15 when the screen is locked for an extended period of time

After updating my iPod Touch to iOS 15 (15.0.1), an issue arose. Initially, the example below works perfectly, allowing me to play the sound multiple times without any problems. However, if I lock the screen on my iPod Touch and return a few minutes later ...

Is there a distinction between including empty arrays within the method and passing them as object parameters in writing?

When it comes to writing empty arrays in JavaScript, is there a difference between declaring them inside the method like this: var example = { calcMethod: function() { this.array1 = []; this.array2 = []; } }; and declaring them as ...

Guide on integrating angular-schema-form into an Ionic 2.0 project using typescript

Recently, I embarked on creating an app with Ionic from scratch and decided to integrate the framework. While I faced no issues executing the example on a webpage, I encountered difficulties when attempting to do so with Ionic. To kickstart the project, ...

Use JavaScript to input array elements into a selection of cells in Excel

At this moment, the loop I am executing successfully retrieves the necessary values. However, I am facing challenges when it comes to inserting these array values into a range of cells. I keep encountering the following error message: Error message: "The ...

Enabling access to process and process.env in the latest version of Webpack, version 5

I'm currently facing an issue with setting the basename of a react-router-dom BrowserRouter using environment variables. Unfortunately, Webpack 5 does not support accessing environment variables directly. After researching on Stack Overflow, I came a ...

Ways to create a table with columns from various fields obtained through an API call

Looking to preprocess data received from an API, the raw data is structured as follows: https://i.sstatic.net/a9Q2Z.png Desiring to dynamically generate a table with columns based on the fields task_name and saved_answers. It's important to note tha ...

Identifying the Operating System of Your Device: iOS, Android or Desktop

I am in need of displaying different app download links based on the user's operating system. This includes IOS, Android, or both if the user is accessing the page on a Desktop device. I am currently utilizing React and Next.js for this project. Unfor ...