Giter Club home page Giter Club logo

Comments (4)

nicped avatar nicped commented on July 17, 2024

Hi Harshal

Thank you for trying out Swiffy Slider.

I agree that the configuration page does not take that into consideration.
In your implementation you just remove the remainder of the indicators from the markup. Simply just include 2 instead of the 6 proposed by the configurator.

Remember that the indicators are not calculated by Swiffy Slider it self - since all of Swiffy slider is simply markup. So it is just the configurator on the doc site that has this problem and not swiffyslider it self.

from swiffy-slider.

nicped avatar nicped commented on July 17, 2024

I see you compare to Swiper - swiper is a lot of JS that creates markup. Swiffy does it the other way around - you create some markup and Swiffy Slider script will slide that for you. Nothing is calculated.

from swiffy-slider.

harshal759 avatar harshal759 commented on July 17, 2024

Hii @nicped ,

Thank you for a quick response.

I agree that swiffy slider is markup based but the thing is that we work on a CMS platform and all that markup is generated on the fly, server side using an templating engine called sightly. Sightly doesn't support any calculation logic. Any suggestions on how we can tackle this issue?

from swiffy-slider.

nicped avatar nicped commented on July 17, 2024

Simply remove or hide indicators you do not need using a bit of JS:

let sliderElement = document.getElementById('mySlider');
let container = sliderElement.querySelector(".slider-container");

let indicators = sliderElement.querySelectorAll(".slider-indicators>*");
let pageCount = container.childElementCount / 2; /*2 is the number of slides per page*/
let indicatorIndex = 0;
indicators.forEach(element => {
    if(indicatorIndex > pageCount){
        element.style.display = "none";
    }
    indicatorIndex++;
});

from swiffy-slider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.