Comments (4)
Hi,
I thought about doing it this way but:
- This doesn't work when
slidesToScroll > 1
. And there's no easy fix such as adding the number ofslidesToScroll
to thereturnIndex
or something, becausereturnIndex
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 asatStart
andatEnd
that returns the corresponding truth values. - 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.
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.
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.
Any updates about this features? Can we now hide controls when they are not "active"?
from lory.
Related Issues (20)
- initialIndex without animation HOT 2
- TypeError: P is undefined when using https://cdnjs.cloudflare.com/ajax/libs/lory.js/2.5.1/lory.min.js HOT 2
- iPhone X — Index Issue HOT 1
- Desktop: Prevent ghost images from dragging on mouseMove (desktop) HOT 3
- Access Lory Instance in EventHandler when creating multiple instances? HOT 1
- On TouchScrolling, snap to next visible slide HOT 3
- BUG: Browser history on drag HOT 4
- .
- How to Set up Automatic Scroll HOT 1
- Improve accessibility HOT 2
- Change the transition direction
- Change transition direction
- Need to add slide specific text content to image in slider HOT 5
- Sliders won't work when is cache deleted HOT 1
- How to add a sound component in grapesjs
- How use jssor.slider.js in grapesjs HOT 1
- ios devices - While swiping right or left page scrolls vertically HOT 1
- Using the API methods in Vanilla JS HOT 2
- Next/Prev "buttons" don't work if above the slider element in the DOM HOT 1
- number of visible slide I suppose expect visible 3 but always show 4 #sadLife NOT WORKING!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lory.