Bootstrap导航栏底部固定移动与平板电脑上的屏幕键盘

时间:2014-03-04 13:16:30

标签: html css twitter-bootstrap mobile

我正在使用引导程序navbar-bottom-fixed作为底部导航栏。每当我需要输入一些东西时,屏幕上的键盘就会显示出来,导航栏会“浮动”到它上面(显示在键盘上方)。

任何想法我怎么能克服这个?如果我只能听键盘节目事件,我可以简单地更改css postion属性,我认为它会起作用。

感谢您的帮助。

2 个答案:

答案 0 :(得分:2)

您可以检查是否使用Jquery聚焦和输入,然后隐藏底栏(如果是。)

像这样:

$('input').focus( function() {
    $('.navbar-bottom-fixed').hide();
});

$('input').blur( function() {
    $('.navbar-bottom-fixed').show();
});

答案 1 :(得分:0)

我这样解决:

<script type="text/javascript">
    $('head').append('<style>.navbar-fixed-bottom{visibility:hidden}@media (orientation:portrait) and (height:' + $(window).height() + 'px){.navbar-fixed-bottom{visibility:visible}}@media (orientation:portrait) and (height:' + $(window).width() + 'px){.navbar-fixed-bottom{visibility:visible}}@media (orientation:landscape) and (height:' + $(window).width() + 'px){.navbar-fixed-bottom{visibility:visible}}@media (orientation:landscape) and (height:' + $(window).height() + 'px){.navbar-fixed-bottom{visibility:visible}}</style>')
</script>
相关问题