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

Have you explored using percentages? #217

Open
Ciantic opened this issue Sep 25, 2018 · 1 comment
Open

Have you explored using percentages? #217

Ciantic opened this issue Sep 25, 2018 · 1 comment

Comments

@Ciantic
Copy link

Ciantic commented Sep 25, 2018

Hello,

I was testing this around, and probably in some legacy browsers this trick would not work, but with Google Chrome this could work:

Instead of this:

width: 1920px; transition: all 200ms ease-out 0s; transform: translate3d(-1440px, 0px, 0px);

Just using percentages:

width: 500%; transition: all 200ms ease-out 0s; transform: translate3d(-20%, 0px, 0px);

Should work. Not sure if it's worth the change, but it wouldn't require changing the widths on the fly, which is sometimes a bit janky.

@johannesjo
Copy link

Yes this would be much better, as you wouldn't need to (often times) wrongly calculate all the pixel values on resize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants