Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 846
A.sharif Avatar asked Feb 10 '12 17:02

A.sharif


1 Answers

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"> 
like image 118
codaniel Avatar answered Sep 30 '22 23:09

codaniel