Skip to content

Instantly share code, notes, and snippets.

@stonehippo
Created March 8, 2012 01:52
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stonehippo/1997964 to your computer and use it in GitHub Desktop.
Save stonehippo/1997964 to your computer and use it in GitHub Desktop.
Adding Webkit native scrolling to an element
.scrolling-element-class * {
-webkit-transform: translate3d(0,0,0);
}
.overthrow-enabled .overthrow {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.scrolling-element-class {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.scrolling-element-class .child-element {
position: relative;
-webkit-transform: translate3d(0,0,0);
}
.scrolling-element {
overflow: auto; /* or overflow: scroll, if that's your thing */
-webkit-overflow-scrolling: touch;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment