Giter Club home page Giter Club logo

Comments (4)

hchargois avatar hchargois commented on August 20, 2024 2

Hi,
I thought about doing it this way but:

  1. This doesn't work when slidesToScroll > 1. And there's no easy fix such as adding the number of slidesToScroll to the returnIndex or something, because returnIndex is inherently broken at the end of the carousel (after the last slide action that slides to the complete end of the carousel, returnIndex is the same as the previous slide). For this to work well and easy enough, the API should have something such as atStart and atEnd that returns the corresponding truth values.
  2. It's a bit complicated for a feature I think is elementary. I understand that you want people to use the API to extend the functionality but since controls were deemed so common that they were built into lory (they could have been left to the user to build with the API instead), then those controls should be powerful enough to cover such a common "enabled/disabled styling" use case. In my opinion it's just as useful as setting an "active" class to the current slide.

from lory.

meandmax avatar meandmax commented on August 20, 2024 2

Hey @hchargois,

sorry for the late answer! Yes u are right so since the controls are already integrated in lory I totally understand your point. So if u want and still need this feature, make a pull-request on that.

Thanks for contributing!
Max

from lory.

meandmax avatar meandmax commented on August 20, 2024

Hey @hchargois,

you could do this by using returnIndex and compare the value with the total length of the slides or zero! And I would do this always on "after.lory.slide".

If "infinite" is false, and the returned index is either 0 or the max length of your slides, then you add/remove a class which shows the active/inactive state.

Does this help?

from lory.

maximerabot avatar maximerabot commented on August 20, 2024

Any updates about this features? Can we now hide controls when they are not "active"?

from lory.

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.