【问题标题】:Cannot disable tap toggling of Fixed Headers in JQuery Mobile无法在 JQuery Mobile 中禁用固定标题的点击切换
【发布时间】:2013-03-04 13:51:26
【问题描述】:

我正在使用 JQuery Mobile(版本 1.3.0)开发一个网络应用程序。它使用固定的标题,但当用户点击表单内容时,我无法禁用“点击切换”行为。

我尝试使用属性“data-tap-toggle=false”,但它不起作用。当用户点击表单时,标题继续隐藏,再次点击时显示。

提前致谢!

<div data-role="page" class="Page" id="parameter_page">
    <div data-role="header" data-position="fixed" data-tap-toggle="false">
        <div class="headerContainer" >
            <a href="index.html"      data-role="button" class="ui-btn-left"  data-inline="true" data-direction="reverse" data-icon="back"  >Voltar</a>
            <a href="instrucoes.html" data-role="button" class="ui-btn-right" data-inline="true" >Instruções</a>
        </div>
    </div>
    ...
    ...
    ...
</div>

【问题讨论】:

  • 嗯..我想我误会了。需要禁用页眉页脚,然后触发全屏?
  • 遇到同样的问题。找到解决方案了吗?

标签: jquery-mobile


【解决方案1】:

首先,为了使用data-tap-toggle,您必须将data-fullscreen="true"data-position="fixed" 添加到HeaderFooterdata-tap-toggle 现在不需要了,因为您可以动态控制它们。

然后以这种方式控制它们。

$("[data-role=header],[data-role=footer]").fixedtoolbar({ tapToggle: true });

$("[data-role=header],[data-role=footer]").fixedtoolbar({ fullscreen: true });

点击或点击时,两者都会出现然后消失。

测试它here

希望我能帮到你。

【讨论】:

    猜你喜欢
    • 2012-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-19
    • 1970-01-01
    • 2016-11-22
    相关资源
    最近更新 更多