| Issue 30: | How can I remove the URL bar with iscroll? | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Usually this script would work:
<script type="application/x-javascript">
addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){
window.scrollTo(0,1);
}
</script>
But it doesn´t so...
What can I do?
Oct 18, 2010
I dont´t really get how I should implent this in my code.. Can youshow me/post an example..?
Oct 18, 2010
Hmm.. Again I saw that the code you said was already in the code, but it doesn´t work. The adressbar does show all the time.
Oct 18, 2010
Ok, maybe the trick is to overdimensionate the wrapper div and then it will work.
in my case i have this structure:
<body>
<div id="wrapper">
<div id="scroller">
<div id="panel">
</div>
</div>
</div>
</body>
And i want to scroll the contents of #panel.
And here is a snippet from my css.
#body {
height: 200%;
overflow: hidden;
}
#scroller {
position:relative;
width: 100%;
z-index: 1;
height: 356px;
overflow: hidden;
}
When the document is loaded, you can load init your iScroll object and then call the hide_address_bar();
its really tricky to achieve but at the end it works.
Sometimes you need to play with padding-top of your scroller div...
Oct 21, 2010
To make the scrollbar disappear, you have to set the height of the page higher than the visible area. This is not an iScroll bug, but a device behavior. Please use the discussion group, not the issue tracker, for this kind of issues. Thanks.
Status:
Invalid
|
i've resolved this issue calling this function: function hide_address_bar() { window.scrollTo(0, 1); setTimeout(function () { window.scrollTo(0, 0); }, 0); } in the first line of the setHeight() function. You can find setHeight() function on the project homepage. greetings. Michele