JQuery Mobile (1.1): disable hiding fixed navigation bar

I am using jQuery Mobile 1.1 and I have a fixed toolbar, but I want to disable hiding when the user clicks somewhere on the page. It would be even better if I could set it only for certain elements of the page (for example, click on the input box).

I tried many methods that I found on the Internet (e.g. $.fixedToolbars.setTouchToggleEnabled(false); ), but none of them work, possibly due to version 1.1. You can check my example here: http://jsfiddle.net/Leqpw/

+6
source share
2 answers

Using the JQM v 1.0.x method to disable a fixed toolbar. There are several ways to disable this functionality.

The easiest way is to simply add data-tap-toggle = "false" to the toolbar. But if you don't want to copy and paste a bunch of times into your project, try these other methods.

$('[data-position=fixed]').fixedtoolbar({ tapToggle:false});

You can also configure it so that some elements ignore this behavior.

$('[data-position=fixed]').fixedtoolbar({ tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed" })

Refresh Added more information for a more complete answer.

+10
source

All you have to do is add the following attribute to your title

 data-tap-toggle="false" 

and pressing the switch disappears.

+9
source

Source: https://habr.com/ru/post/911899/


All Articles