-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get visible elements currently in viewport without groupCells #638
Comments
@yaodingyd this could be a good solution, also for the performance part. |
Thanks for opening this feature request. Currently, there is no easy API to get which cells are visible within the viewport. It would require measuring the cells around the selected cell. Definitely doable, but there may be a simpler solution, similar to @yaodingyd's technique of hard-coding how many cells should be able to fit. Add a 👍 reaction to this issue if you would like to see this feature or code added. Do not add +1 comments — They will be deleted. |
Hi @desandro . I have a similar requirement. I'm trying to use flickity with my Angular 5 app. I need to get the cells currently in viewport so that I can perform an action on them. For that I too grouped the cells together and got the is-selected class. Now what is not desirable is that the page dots are mapped to the cell groups instead of being mapped to individual cells.
Can you please help? |
@AanchalKapoor15 for Page dots mapped to individual cells, you can create your own custom navigation UI, except use |
even with This is a much needed API property :) |
I created a pull request (#1032) which can handle this. |
Here's some jQuery I came up with to add an
|
Is it possible to do the same to only the slide at the center? |
Hi @desandro ,
don't know if it is supported in some way, but I wanted to ask help with a issue I'm trying to solve:
I have a carousel with multiple visible elements and wanted to get the current visible elements. in the flickity-viewport.
I can achieve this using groupCells and using the .is-selected class attached to the element in the group.
the problem is that I need the slider to move by one element at a time, and not, for example, in steps of 3 elements using the groupCells option.
Test case: https://codepen.io/anon/pen/oGLjqy
is there a way to do it in a simple way using your plugin's tools or have I to integrate it with something else?
The text was updated successfully, but these errors were encountered: