Question

I'm using Jqtouch to design a iphone app.

As I'm using a standard header/toolbar at the top, I want to simply have it fixed there without moving. I found out how to do this by creating a div with class toolbar and setting CSS display to block and min-height to 0px with important.

However, when it starts up and every time I change pages (technically, it's making different divs display and not display(?)), it autoscrolls to the top of the div that it just changed to, and I need to scroll up to see the toolbar (the toolbar is at the very top, above the div).

How do I make it actually scroll up to the toolbar or top of the page?

Here's a simplified layout of my current code: (For body section)

<body>
<div id="toolbar" class="toolbar" style="display: block; min-height: 0px !important;">
<h1>Header</h1>
<a class="button" href="#">Button</a>
</div>

<div id="home" class="current">
<!--Content in here-->
<a href="#test" class="slideup">Link to next page</a>
</div>

<div id="next">
<!--Content in here-->
</div>
</body>
Was it helpful?

Solution

I am not entirely sure I got your question, but It sounds like you want to have an element with "fixed" position. If that's the case, you may want to try the solution I posted for this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top