Created
March 9, 2016 23:56
-
-
Save rattlion/6e6f47173810e2c0e865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
translate(el, pageX, duration) { | |
var translation = `translateX(${pageX}%)`; | |
var transition = `all ${duration}ms`; | |
el.style.transition = transition; | |
el.style.transform = translation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment