Skip to content

Instantly share code, notes, and snippets.

@vinnihoke
Last active December 6, 2019 21:04
Show Gist options
  • Save vinnihoke/d251d78c5549c68c8e22173ad99479b7 to your computer and use it in GitHub Desktop.
Save vinnihoke/d251d78c5549c68c8e22173ad99479b7 to your computer and use it in GitHub Desktop.
@macjabeth
Copy link

macjabeth commented Jun 18, 2019

Think back to the whiteboard challenge we had with the starting direction and a list of turns. We had a starting index and then made sure we incremented or decremented the index based on which direction the turn was (R or L). We also checked for edge cases like if the index went beyond the bounds of the array. That's something you're going to have to do here inside the advanceCarousel method.

So the value you pass in (which is 1 or -1) must be applied to the index. And then you'll be able to manipulate the images you selected further above (this.images) and work a little JS styling updates to display or hide certain images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment