I have a fixed header on my jQuery mobile project that is set to data-tap-toggle="true".
<div data-role="header" data-position="fixed" data-fullscreen="true" data-id="hdr" data-visible-on-page-show="false" data-tap-toggle="true">
<h1>My Title</h1>
</div><!-- /header -->
The header correctly toggles when tapping on the screen. The problem is that when I tap on a link to open a panel, the header also displays.
<a href="#mypanel" data-role="button" data-inline="true" data-icon="bars" id="panel_link">Test</a>
Here's my panel:
<div data-role="panel" id="mypanel" data-position="right" data-display="overlay" data-theme="b">
<div class="ui-panel-inner">
<p>Content</p>
</div>
</div><!-- /panel -->
I've tried to blacklist the panel button like so:
$( document ).on( "pageinit", "#demo-page", function() {
$("[data-role=header],[data-role=footer]").fixedtoolbar({ tapToggleBlacklist: "a, button, input, select, textarea" });
});
I've also tried to create my own click event that changes the header tapToggle option to false as well as opening only the panel.
$('#panel_link').on('click', function (event) {
$("[data-role=header]").fixedtoolbar( "option", "tapToggle", false );
alert('test');
$( "#mypanel" ).panel( "open" );
event.stopPropagation();
});