Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

javascript - Jquery mobile: Disable "tap to toggle" fixed header and footer

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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">

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...