Jquery mobile:禁用“点击切换"固定页眉和页脚 [英] Jquery mobile: Disable "tap to toggle" fixed header and footer

查看:27
本文介绍了Jquery mobile:禁用“点击切换"固定页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法禁用固定工具栏点击时的淡入/淡出效果?http://jquerymobile.com/demos/1.0.1/docs/toolbars/footer-persist-a.html

基本上,只要您点按背景,或向下和向上滚动,导航栏就会淡出/淡入.

找了好久才发现这个

[a link] jquery 移动静态页脚无切换

基本上它说向下和向上滚动淡入/淡出将在新更新中得到修复.(如果您对如何在更新之前解决此问题有任何想法,我将不胜感激)

我也有在点击背景时切换页脚的问题.到目前为止,我发现的所有代码都不能很好地工作.

示例:如何修复 jQuery Mobile 的固定页脚?

javascript 在那里不起作用:/

如果您知道如何解决这些问题,或者有什么建议,我将不胜感激

解决方案

如果您想在 Jquery Mobile 1.0 版本中禁用点击来切换固定页脚,您可以使用以下方法:

$(function(){$.mobile.fixedToolbars.setTouchToggleEnabled(false);});

Jquery Mobile 1.1 将您设置点击切换功能的方式更改为如下所示:

$(function(){$('[data-role=header],[data-role=footer]').fixedtoolbar({ tapToggle:false });});

或者在 JQM 1.1 中你可以简单地设置 data-tap-toggle="false":

Is there a way to disable the fade in / fade out effect on tap with fixed toolbar ? http://jquerymobile.com/demos/1.0.1/docs/toolbars/footer-persist-a.html

Essentially anytime you tap the background, or scroll, down and up, the nav bar will fade out/in.

I have been looking for a while now and I came across this

[a link] jquery mobile static footer without toggle

essentially it says that the scroll down and up fade in/out will get fixed in the new update. (If you have any ideas on how to get around this until the update, I would really appreciate it)

I also have the problem of toggling the footer when I tap the background. All the code I have found so far hasn't worked well at all.

example : How to fix jQuery Mobile's fixed footer?

javascript in there doesn't work :/

So please if you know how to solve these problems, or have suggestions, I would really appreciate it

解决方案

If you want to disable the tap to toggle a fixed footer for version Jquery Mobile 1.0 you can use something like this:

$(function(){
  $.mobile.fixedToolbars.setTouchToggleEnabled(false);
});

Jquery Mobile 1.1 changes the way you set the tap toggle feature to something like this:

$(function(){
  $('[data-role=header],[data-role=footer]').fixedtoolbar({ tapToggle:false });
});

or in JQM 1.1 you can simply set data-tap-toggle="false":

<div data-role="header" data-position="fixed" data-tap-toggle="false">

这篇关于Jquery mobile:禁用“点击切换"固定页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆