Last Updated: February 25, 2016
·
1.463K
· blastbeat

Preventing elastic scroll

$(window).on 'touchmove', (e) ->
    e.preventDefault()

$(window).scroll (e) =>
  if $(window).scrollTop() < 2
     $(window).scrollTop(1)

2 Responses
Add your response

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 ·