0

I'm currently developing a small WebApp that makes use of

Now I encountered a conflict that appears on touch enabled devices as well as on desktop/mouse controlled "click" events: When I "tap" or "click" the map to actually "pan" it, then my header/footer toggles it's visibility. As I want to keep the toggle behaviour, I can't simply deactivate it, but showing/hiding the header/footer on every "pan" of the map is odd. After thinking some time about it, I think I got a concept that should work:

Question: How I can I add a delay to the visibility toggle for the header/footer? So when I don't release the finger/mouse after XYms, the header/footer doesn't show/hide?

Example:

jQuery( '#map_page' ).live( 
    "pageinit"
    ,function() 
    {
        // Att.: pseudo code
        if ( $.mobile.taphold )
            don't toggle fixed
        if ( mousedown > XYms )
            don't toggle fixed
    }
);

Thanks!

kaiser
  • 21,817
  • 17
  • 90
  • 110

1 Answers1

1

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

Here's the solution.

JQM 1.0:

$(function(){
  $.mobile.fixedToolbars.setTouchToggleEnabled(false);
});

JQM 1.1:add property data-position="fixed" to header/footer.

Community
  • 1
  • 1
Rain Diao
  • 926
  • 6
  • 12