Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- element {
- -webkit-overflow-scrolling: touch;
- }
- element > * {
- -webkit-transform: translateZ(0px);
- }
- -webkit-transform: translate3d(0, 0, 0);
- <div class="relative-to-me">
- <div class="scrollable">
- <div class="absolutely-positioned">
- </div>
- </div>
- </div>
- .absolutely-positioned {
- will-change: transform;
- }
- <!-- 🍉 JQuery Functions-->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
- <script type="text/javascript">
- //🍋 Apply -webkit-overflow-scrolling in Every TouchEnd
- $(document).on('click touchend', function(event) {
- $("#TestDIV").css({"-webkit-overflow-scrolling":"touch"});
- });
- </script>
- <!-- 🍉 html Elements & Style -->
- <div id="TestDIV">
- <div class="Element"></div>
- <div class="Element"></div>
- <div class="Element"></div>
- <div class="Element"></div>
- <div class="Element"></div>
- </div>
- <style>
- #TestDIV{
- white-space: nowrap;
- overflow-x: scroll;
- -webkit-overflow-scrolling:touch;
- }
- #TestDIV .Element{
- width:300px;
- height:300px;
- margin: 2px;
- background-color: gray;
- display: inline-block;
- }
- #TestDIV .Element:nth-child(odd){
- background-color: whitesmoke;
- }
- </style>
Add Comment
Please, Sign In to add comment