简体   繁体   English

jQuery Mobile底部导航栏

[英]Jquery mobile bottom navbar

I have an issue and really don't know how to solve this.. I have an sticky footer like this: 我有一个问题,真的不知道该如何解决..我的页脚像这样:

<!-- FOOTER ICON TABS -->           
          <div data-role="footer" data-position="fixed" data-tap-toggle="false">        
            <div class="footer" data-role="navbar">
              <ul>
                <li>
                  <a href="#dashboard" data-icon="dashboard" class="ui-btn-active" id="icon-dashboard">
                    <span class="navbar-text">Dashboard</span>
                  </a>
                </li>
                <li>
                  <a href="#" data-icon="progress" id="icon-progress">
                    <span class="navbar-text">Voortgang</span>
                  </a>
                </li>
                <li>
                  <a href="#map" data-icon="security" id="icon-security">
                    <span class="navbar-text">Plattegrond</span>
                  </a>
                </li>
                <li>
                  <a href="#" data-icon="security" id="icon-security">
                    <span class="navbar-text">Securitycheck</span>
                  </a>
                </li>
              </ul>   
            </div>
          </div>

Thereby I set this styling: 因此,我设置了以下样式:

.ui-footer, .footer, .footer li, .footer a, .footer a:after {
    background-color: transparent !important;
    border-color: transparent !important;
    height: 70px;
}

But It is annoying because my content is behind the icons and it is not nice. 但这很烦人,因为我的内容在图标后面,而且不好。 It looks like this: 看起来像这样: 在此处输入图片说明

I allready have changed the heights of the white blocks, but the blocks are not having a hard height. 我已经准备好更改白色块的高度,但是这些块的高度并不高。 This ecause the notification block is dynamic and the content vary from length. 这是因为通知块是动态的,并且内容随长度而变化。 Thereby the second block has an collapsable block where Boardingpass is writen. 因此,第二个块具有可折叠的块,在其中写入了Boardingpass。

How it has to look: 外观: 在此处输入图片说明

Here is a FIDDLE which recreates the problem. 这是一个重现问题的字段 I hope someone could help me out on this :) 我希望有人可以帮我这个忙:)

You could just set the bottom margin: 您可以设置下边距:

#flight-info-block {
  margin-bottom: 80px !important;
}

also in code, use the third parametef of the slideToggle function to achieve the same effect at the end of the animation: 同样在代码中,使用slideToggle函数的第三个参数在动画结束时实现相同的效果:

//open up the content needed - toggle the slide- if visible, slide up, if not slidedown.
$content.slideToggle("slow", "swing", function() {
    $("#flight-info-block").css("margin-bottom", "80px");
    $("#flight-info-block").trigger("updatelayout");
});

BTW: i also dislike the transparent background, then i added following rule at the bottom of your CSS: 顺便说一句:我也不喜欢透明背景,然后在CSS底部添加了以下规则:

.footer {
  background-color: #00a0e5 !important;
}

and removed also your -350 offset in scrollTop: 并还删除了您在scrollTop中的-350偏移量:

$('html, body').animate({
    scrollTop: $header.offset().top
}, 1000);

Your updated Fiddle: http://jsfiddle.net/yTt9b/1787/ 您更新的小提琴: http : //jsfiddle.net/yTt9b/1787/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM