admin管理员组文章数量:1405871
Good day, i have a meta like this
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalabale=no, width=device-width, height=device-height" />
Now i can get the height view port with js i want to use it to modify my footer so it stays always at the bottom of the screen using either a fixed positioning. here is the footer css
#footer
{
height:30px;
background-color:#D9D9D9;
background-image:url(../images/footer.png);
background-repeat:repeat-x;
margin-top:20px;
width:100%;
/*bottom:0;
position:fixed;*/
}
how do i modify this footer using JS to get the right thing. Thank you. @cyberomin.
Good day, i have a meta like this
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalabale=no, width=device-width, height=device-height" />
Now i can get the height view port with js i want to use it to modify my footer so it stays always at the bottom of the screen using either a fixed positioning. here is the footer css
#footer
{
height:30px;
background-color:#D9D9D9;
background-image:url(../images/footer.png);
background-repeat:repeat-x;
margin-top:20px;
width:100%;
/*bottom:0;
position:fixed;*/
}
how do i modify this footer using JS to get the right thing. Thank you. @cyberomin.
Share asked Dec 1, 2010 at 12:12 CyberominCyberomin 5232 gold badges8 silver badges23 bronze badges4 Answers
Reset to default 1See also Google's solution to this http://code.google./mobile/articles/webapp_fixed_ui.html
document.getElementById("footer").style.position = "fixed";
If you by mobile browser mean "mobile safari", you're out of luck, it does not support position fixed.
Related answer: Fixed positioning in Mobile Safari
Edit: This project might be helpful for you -> http://cubiq/iscroll
The position:fixed is available since Android 2.2.
However for other devices like IPhone, you must have a solution that simulates the native scroller : this type of solution is available through the JavaScript toolkit Wink. This toolkit allows to make WebApps easily while remaining simple to use (no need to learn an API). Look at the examples on the Scroller ponent.
本文标签: javascriptFixed position on a mobile browser for footerStack Overflow
版权声明:本文标题:javascript - Fixed position on a mobile browser for footer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744953204a2634203.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论