Skip to content

Instantly share code, notes, and snippets.

@RitaDias
Created January 16, 2017 14:40
Show Gist options
  • Save RitaDias/4ff5eacc52e92130aabda8b108fb66bb to your computer and use it in GitHub Desktop.
Save RitaDias/4ff5eacc52e92130aabda8b108fb66bb to your computer and use it in GitHub Desktop.
if ((translateX < (-menuWidth) / 2) || (Math.abs(translateX) / timeTaken > velocity)) {
// if menu is open, this represents the close condition
if (translateX > menuWidth / 2 || (Math.abs(translateX) / timeTaken > velocity)) {
// if menu is closed, this represents the open condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment