29

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

Community
  • 1
  • 1
A.sharif
  • 1,977
  • 1
  • 16
  • 27

1 Answers1

73

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">
codaniel
  • 5,263
  • 1
  • 23
  • 32
  • 1
    The third strategy only works when the page is fresh. If you update, change or otherwise generate the header code, the trigger("create") does not affect the header or footer. So you will end up with unstyled and taptoggle enabled. The javascript versions are the only option for this situation, unless someone knows how to manually trigger "enhance" on jquery mobile header or footer. – Chris May 14 '13 at 20:27
  • It works for all cases when you put script between `jquery` and `jquery-mobile` but this time header and footer overlaps main content. – Davut Gürbüz Aug 11 '15 at 07:42