Skip to content

Scaling slides while transitioning #370

Closed Answered by blimpmason
blimpmason asked this question in Help
Discussion options

You must be logged in to vote

@davidjerleke one last quick question for you! I ended up compromising with the designer and only showing 2 slides at a time instead of three. The method in the codesandbox demo above works in this case.

The only issue now is that the following code breaks with the latest version of embla-carousel-react (the codesandbox you linked is using v 6.0.2):

if (engine.options.loop) {
	engine.slideLooper.loopPoints.forEach((loopItem) => {
		const target = loopItem.getTarget();
		if (index === loopItem.index && target !== 0) {
		        const sign = Math.sign(target);
		        if (sign === -1)
			        diffToTarget =
				        (scrollSnap - (1 + scrollProgress)) * slideCountMultiplier;
		     …

Replies: 1 comment 8 replies

Comment options

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

@blimpmason
Comment options

@davidjerleke
Comment options

@blimpmason
Comment options

Answer selected by davidjerleke
@blimpmason
Comment options

@davidjerleke
Comment options

@davidjerleke
Comment options

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