Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Nav Doesn't Scroll #3

Open
pfiller opened this issue Jun 28, 2012 · 4 comments
Open

Nav Doesn't Scroll #3

pfiller opened this issue Jun 28, 2012 · 4 comments

Comments

@pfiller
Copy link
Contributor

pfiller commented Jun 28, 2012

If the nav is taller than the viewport, there's no way to get to the bottom.

@syropian
Copy link

Sad to see this issue hasn't been addressed. Any chance for a fix yet? I tried setting an overflow-y on all sorts of things, and nothing's working.

@steve228uk
Copy link

I've managed to get this working on my project.

Here's the layout of my sidetap nav

<div class="stp-nav">
<div>
<div class="searchBox">
<input type="text" placeholder="Search">
</div>

<div class="scrollNav">
<div class="scrollNav">
<nav>
<a href="#posts" class="selected">Posts</a>
<a href="#groups">Groups</a>
<a href="#following">Following</a>
<a href="#followers">Followers</a>
</nav>
</div>
</div>

</div>
</div>

The scrollNav is just a div with the following styles

.scrollNav{
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}

By wrapping it in two divs you stop the user from being able to pull the top of the browser and showing the usual bounce-back behaviour on iOS.

This seemed to work but I had a problem with it bouncing back. It looks like Sidetap gives the nav the height of the entire page which breaks the scrolling.

To fix this I set the height of it in my JS.

var height = $(window).height()-44+'px';
$('.scrollNav').css('height', height);

The "-44" is because I've added a search box above so to get the correct height I needed to take that out of the equation.

@jampafoo
Copy link

jampafoo commented Apr 2, 2013

Thanks! Works pretty good, but there are some issues I have encountered with this code.

I have been trying all kinds of things but can not get it to work completely... there is an issue with height of scroll area ... also, if the phone is turned vertically or horizontally on load. All of the nav items are not visible and get cut off even with scroll.

Also, I know this is meant more for iOS... but, this does not currently work on Android phones that I have tested. So, still trying to make a fix for that too.

Thanks for this! This is a great start for me.

@steve228uk
Copy link

@jampafoo Yeah, the Android issue was one I was aware of. I guess adding some kind of JS based scroll as SideTap implements for the main content area would be the ideal solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants