Guest User

Untitled

a guest
Nov 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. element {
  2. -webkit-overflow-scrolling: touch;
  3. }
  4.  
  5. element > * {
  6. -webkit-transform: translateZ(0px);
  7. }
  8.  
  9. -webkit-transform: translate3d(0, 0, 0);
  10.  
  11. <div class="relative-to-me">
  12. <div class="scrollable">
  13. <div class="absolutely-positioned">
  14. </div>
  15. </div>
  16. </div>
  17.  
  18. .absolutely-positioned {
  19. will-change: transform;
  20. }
  21.  
  22. <!-- 🍉 JQuery Functions-->
  23.  
  24. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  25. <script type="text/javascript">
  26.  
  27. //🍋 Apply -webkit-overflow-scrolling in Every TouchEnd
  28. $(document).on('click touchend', function(event) {
  29. $("#TestDIV").css({"-webkit-overflow-scrolling":"touch"});
  30. });
  31.  
  32. </script>
  33.  
  34.  
  35.  
  36. <!-- 🍉 html Elements & Style -->
  37.  
  38. <div id="TestDIV">
  39. <div class="Element"></div>
  40. <div class="Element"></div>
  41. <div class="Element"></div>
  42. <div class="Element"></div>
  43. <div class="Element"></div>
  44. </div>
  45.  
  46. <style>
  47. #TestDIV{
  48. white-space: nowrap;
  49. overflow-x: scroll;
  50. -webkit-overflow-scrolling:touch;
  51. }
  52.  
  53. #TestDIV .Element{
  54. width:300px;
  55. height:300px;
  56.  
  57. margin: 2px;
  58.  
  59. background-color: gray;
  60.  
  61. display: inline-block;
  62. }
  63. #TestDIV .Element:nth-child(odd){
  64. background-color: whitesmoke;
  65. }
  66. </style>
Add Comment
Please, Sign In to add comment