Skip to content
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

Start at the end (One item per frame) #222

Closed
Nycko97 opened this issue Oct 1, 2015 · 4 comments
Closed

Start at the end (One item per frame) #222

Nycko97 opened this issue Oct 1, 2015 · 4 comments

Comments

@Nycko97
Copy link

Nycko97 commented Oct 1, 2015

Hi,
I would like the last "item_year" get the class "active", not the first for start the slide from the left. How can I do this ? What could I change in the sly.js or anything else ? I try with startAt but it don't work and here on the picture there is only 3 "div" but in the future it will change so i can't put a static number.
I hope that you'll understand what I mean and sorry if my english is not correct.

Thank you

capture d ecran 2015-10-01 a 03 44 16

@darsain
Copy link
Owner

darsain commented Oct 1, 2015

I'm not 100% sure, but you can try using negative index in startAt option to select last item, like so:

startAt: -1

Should work.

If it doesn't, you can still use Sly's API to do what you want. Just call toEnd after the initialization:

new Sly(frame, options).init().toEnd();

@darsain darsain closed this as completed Oct 1, 2015
@Nycko97
Copy link
Author

Nycko97 commented Oct 1, 2015

Thank you it's work well with "toEnd".
An other relative question, when the page load I see the effect from the first item to the last. How can I remove this effect to show the last item without the sliding (only when I arrive at the page)

@darsain
Copy link
Owner

darsain commented Oct 1, 2015

new Sly(frame, options).init().toEnd(true);

@Nycko97
Copy link
Author

Nycko97 commented Oct 1, 2015

Thank you 👍 for the rapidity and the efficiency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants