Preventing elastic scroll
$(window).on 'touchmove', (e) ->
e.preventDefault()
$(window).scroll (e) =>
if $(window).scrollTop() < 2
$(window).scrollTop(1)
Written by Maksim
Related protips
2 Responses
Can't you do something less drastic by just using overflow-y: scroll without using -webkit-overflow-scrolling: touch;
I am assuming you are trying to disable elastic scrolling on iPhones. Isnt using overflow-y: scroll without -webkit-overflow-scrolling exactly that? I might be wrong here, let me know!
over 1 year ago
·
This is not for Apple devises, i try to prevent elastic scroll in my project https://dev.staply.co, but i don't know css well and did it with js :)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Js
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#