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

Feature request - allow slide=<index> to be set at page load time #12591

Closed
mikeatkinsonthesecond opened this issue Dec 22, 2017 · 10 comments
Closed
Assignees
Milestone

Comments

@mikeatkinsonthesecond
Copy link

I've built an amp-carousel with a number of slides, each of which is relevant for a different time of day.

On pageload, I display an amp-list using some external JSON data. I would like to pass back in that JSON an indication of which slide should currently be displayed, and then call carousel.goToSlide to jump to that slide

This is currently not possible as carousel.goToSlide can only be triggered by a user interaction. This could apparently theoretically be supported by a selected attribute on a specific amp-carousel slide

@jridgewell
Copy link
Contributor

/cc @choumx. I believe this is possible with <amp-bind>.

@aghassemi
Copy link
Contributor

aghassemi commented Dec 22, 2017

bind can change the slide via [slide] attribute but slide attribute is not available for the page load case.

@ericlindley-g and I were coincidentally talking about this yesterday. We should be able to support slide as a normal attribute and not just for bind.

I will take the issue.

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @aghassemi Do you have any updates?

@aghassemi
Copy link
Contributor

Similar to #16110 #12659

@aghassemi aghassemi changed the title Feature request - add 'selected' attribute to carousel slide Feature request - allow slide=<index> to be set at page load time Jul 16, 2018
@aghassemi
Copy link
Contributor

I will take this for FIXIT.

@TWsky
Copy link

TWsky commented Oct 16, 2018

Hi @aghassemi , willing to know is this FR been scheduled to implement? Having a partner blocked by setting default slide index differently when page is on-load.

@aghassemi
Copy link
Contributor

/to @nainar

@TWsky We are working on a new version of Carousel and CCed above is @nainar who is PMing the feature. Something we can consider for the new version. We could also consider adding this to the old one if @nainar sees fit.

@francesconatali
Copy link

Hi Everyone, I'm interested in this as well (to allow slide=<index> to be set at page load time). It looks like a really needed feature. I'll keep an eye on this thread for updates. 🙏

@ampprojectbot
Copy link
Member

This issue hasn't been updated in awhile. @aghassemi Do you have any updates?

@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Jan 30, 2021
@stale stale bot closed this as completed Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants