4

$(window).scrollTop() is coming 0 for every scroll position in mobile. Tried using $("body"), $(document). I need to find pixels that are hidden from view above the scrollable area in mobile. This piece of code works perfectly fine for Desktop.

Edit: Issue Resolved. Css issue. After I removed overflow-x: hidden from Body, its working fine now.

pnkz
  • 326
  • 4
  • 20
  • Have you tried `$("html").scrollTop()` ? Also your question implies that you haven't quoted body in $(body) (it should be `$("body")` ) is that a typo? – apokryfos Feb 25 '16 at 12:44
  • 1
    Yes i tried $("html").scrollTop() and $("body"). – pnkz Feb 25 '16 at 12:45
  • 1
    http://stackoverflow.com/questions/12260279/scrolltop-not-working-in-android-mobiles Sounds similar to this. – apokryfos Feb 25 '16 at 12:49
  • Have you seen the ScrollTo plugin? It's the only ScrollTo plugin I've found that seems to be fully mobile friendly. http://balupton.github.io/jquery-scrollto/ – SISYN Feb 25 '16 at 15:26

0 Answers0