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
AMP SlideScroll Experiment: enable looping. #3680
Conversation
9ca3854
to
482f0a6
Compare
position: relative; | ||
white-space: nowrap; | ||
position: relative !important; | ||
text-align: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text-align
again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed :)
634328d
to
8c77301
Compare
PTAL |
.-amp-carousel-end-marker { | ||
background-color: transparent !important; | ||
display: block !important; | ||
flex: 1 0 1px !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be 0 0 1px
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and done!
be21077
to
82b5362
Compare
@@ -158,26 +174,32 @@ export class AmpSlideScroll extends BaseCarousel { | |||
// (which is at scrollLeft 0) when slide 0 is requested - for all other | |||
// instances we show the second slide (middle slide at | |||
// scrollLeft = slide's width). | |||
const newScrollLeft = (newIndex == 0) ? 0 : this.slideWidth_; | |||
let newScrollLeft = this.slideWidth_; | |||
if ((!this.hasLooping_ && newIndex == 0) || noOfSlides_ == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another formula here, if you'd like it better:
if (showIndexArr[0] == newIndex) {
newScrollLeft = 0;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again taken care by setting hasLooping = false
where there is only one slide.
6ca1437
to
92fe8a5
Compare
LGTM |
In this PR
Yet to come
Part 4 for - #3465