Vandzelyak / iscroll-js

Automatically exported from code.google.com/p/iscroll-js
MIT License
0 stars 0 forks source link

How can I remove the URL bar with iscroll? #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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?

Original issue reported on code.google.com by larsvona...@gmail.com on 30 Sep 2010 at 6:16

GoogleCodeExporter commented 8 years ago
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

Original comment by michele....@gmail.com on 16 Oct 2010 at 4:00

GoogleCodeExporter commented 8 years ago
I dont´t really get how I should implent this in my code.. Can youshow me/post 
an example..?

Original comment by tidning...@gmail.com on 18 Oct 2010 at 11:11

GoogleCodeExporter commented 8 years ago
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.

Original comment by tidning...@gmail.com on 18 Oct 2010 at 12:04

GoogleCodeExporter commented 8 years ago
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...

Original comment by michele....@gmail.com on 18 Oct 2010 at 9:25

GoogleCodeExporter commented 8 years ago
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.

Original comment by mat...@gmail.com on 22 Oct 2010 at 6:31