When building my mobile website, I had to add these properties to my body to eliminate excess whitespace:
html,body
{
width: 100%;
margin: 0px;
padding: 0px;
overflow-y: scroll;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
However, my jQuery scrollTop functions, regarding parallax and the navbar, do not work now. These functions do not work on mobile.
$n = ".navbar";
$(window).scroll(function(){
if($(window).scrollTop() > 300){
$($n).css("background-color", "rgba(255,255,255,.2)");
} else {
$($n).css("background-color", "transparent");
}
});
I have tried removing the overflow from the body, and keeping it solely on HTML, and vice versa, which does fix my issue, however the whitespace returns. I have looked online, however I cannot seem to find anything regarding this issue.
If you want to view the website, the URL is http://studysesh.us. Keep in mind, it is just beginning, currently the homepage is the only page. Thank you.
-webkit-overflow-scrolling: touch;is the cause. (testing in vivaldi with google dev tools)