本文介绍了JQueryMobile Fading NavBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何停止固定的导航栏从淡入淡出每次我滚动。我使用jquerymobile 1.0.1与下面的代码,但我不能忍受导航条如何退出:

Does anyone know how to stop a fixed navbar from fading in and out every time I scroll. I'm using jquerymobile 1.0.1 with the following code but I can't stand how the nav bar fades in and out:

<div data-role="footer" data-id="foo1" data-position="fixed">
    <div data-role="navbar">
        <ul>
            <li><a href="footer-persist-a.html" class="ui-btn-active ui-state-persist">Friends</a></li>
            <li><a href="footer-persist-b.html">Albums</a></li>
            <li><a href="footer-persist-c.html">Emails</a></li>
            <li><a href="footer-persist-d.html">Emails</a></li>
            <li><a href="footer-persist-e.html">Emails</a></li>

        </ul>
    </div><!-- /navbar -->
</div><!-- /footer -->

我不只是想要切换修复。我希望它100%可见100%的时间。思考?

I don't just want the "toggle" fix. I would like it stay 100% visible 100% of the time. Thoughts?

推荐答案

对于JQM 1.1,你实际上在页脚上设置data-tap-toggle =false >

Well for JQM 1.1 you actually set data-tap-toggle="false" on your footer.

<div data-role="footer" data-position="fixed" data-tap-toggle="false">
...
</div>

我喜欢这样做,以便在每个页面以及每个固定的工具栏,页眉或页脚中禁用tapToggle:

I like to do this to disable tapToggle in every page and also every fixed toolbar, header or footer:

$(document).on('pageinit','[data-role=page]', function(){
    $('[data-position=fixed]').fixedtoolbar({ tapToggle:false });
});

这样我就不必继续输入data-tap-toggle =false

That way I don't have to keep typing data-tap-toggle="false" over and over.

然后,如果您使用JQM 1.0.1:

Then if your using JQM 1.0.1 do:

$('[data-role=page]').live('pageinit', function(){
    $.mobile.fixedToolbars.setTouchToggleEnabled(false);
});

这篇关于JQueryMobile Fading NavBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 07:07