Skip to content

Variable Size Thumbnails #277

Closed Answered by davidjerleke
calvinsomething asked this question in Help
Discussion options

You must be logged in to vote

Hi @calvinsomething,

Embla reads the getBoundingClientRect().height property on your slides when axis: 'y' in order to calculate the slide positions. The scroll probably breaks because getBoundingClientRect().height returns 0 when you don't specify any height on your vertical thumbnails:

The main problem being that if you don't specify any height, your thumbnails won't have any height until the images have loaded. And if you initialize your thumbnail carousel before the thumbnails have any height, calculating the scroll positions from the slide heights will fail.

If your image endpoint provides the image sizes from the server, you can create placeholders for your thumbnails when server s…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@calvinsomething
Comment options

@davidjerleke
Comment options

@calvinsomething
Comment options

@davidjerleke
Comment options

@calvinsomething
Comment options

Answer selected by calvinsomething
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants