2013-03-04 55 views
2

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

我试过使用属性“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> 
+0

嗯..我想我错了。你需要禁用页眉和页脚,然后触发全屏? – Omar 2013-03-04 14:29:47

+0

有同样的问题。有没有找到解决方案? – xdhmoore 2013-08-05 21:37:37

回答

0

首先,为了利用data-tap-toggle您对添加data-fullscreen="true"data-position="fixed"页脚。现在不需要data-tap-toggle,因为您可以动态控制它们。

然后用这种方法控制它们。

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

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

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

测试它here

我希望我一直在帮助。