Last active
August 29, 2015 14:07
-
-
Save RyoSugimoto/3b62bef97bdfe38cc441 to your computer and use it in GitHub Desktop.
スマートフォンで、ページを読み込んだときに、ブラウザのアドレスバーを隠す。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("load", function() { | |
setTimeout(scrollBy, 100, 0, 1); | |
}, false); | |
// setTimeout()は | |
// 第三引数以降で、 | |
// 第一引数で渡した関数に渡す値を | |
// 指定できる | |
// scrollByではなくscrollToを使う方法が | |
// よく紹介されているが、 | |
// すでにユーザーがスクロールしていた場合でも | |
// トップに戻されてしまうのでNG | |
// 参考 | |
// http://d.hatena.ne.jp/scientre/20130611/hide_addressbar_on_iphone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment