Closed ghost closed 9 years ago
You have to specify itemSelector
option, and call .reload()
when something changes.
Yes but If I hide some item even with the selector (add :not() css property) it will not match the right active item after reload. There is a problem for sure. The active item after reload doesn't work if the element was hidden before to reload.
Is there a way to refind the current item in the middle?
Yeah, Sly can't account for that. I would have to implement a diffing engine...
The answer is don't hide, but use add & remove methods.
But your selector option finally do not do what is intended for. Reload doesn't take into account selector option. Maybe can you just point me where I can find the function to modify or just how can I just find the new centered item.
The whole Sly API is documented in docs folder. I won't tell you anything new.
Selector option was hacked in when one of the guys requested it. It works, but there are issues.
The preferred way how to manage elements is via add & remove methods. Both documented in the link above.
Hello,
I use Sly with forcecentered itemNav and use activateMiddle and activeOn (click). It works fine but if I hide some elements (I know it's not recommanded), then the index of the active element (on the middle) is wrong. How can I modify this behaviour. Is there a way to only search prev/next index for item that don't have a certain css class?
I just need to know where I can find the code that retrieve the acitveMiddle index. I try with getIndex() but without success (because I can't know if the slider was slide left or right)...
Thank you.
lolo