0

I have a show hide menu that works on desktop but does not work on mobile?

$( ".open-mob-menu" ).click(function() {
    $( ".open-mob-menu").hide();
    $( ".close-mob-menu").show();
}); 

$( ".close-mob-menu" ).click(function() {
    $( ".open-mob-menu").show();
    $( ".close-mob-menu").hide();
}); 
Steve
  • 7,833
  • 9
  • 42
  • 87
  • 2
    Is a 'click' function the same as a 'tap' function? - http://stackoverflow.com/questions/12422944/what-is-the-difference-between-the-click-and-tap-events – Paulie_D Sep 11 '14 at 10:08
  • look here: http://stackoverflow.com/questions/6235794/jquery-mobile-for-every-live-tap-event-should-there-be-an-equivalent-click-even – rvandoni Sep 11 '14 at 10:11
  • Use Vclick or tap event it work for both desktop and mobile before applying refer this http://stackoverflow.com/questions/15274809/in-jquery-mobile-whats-the-diff-between-tap-and-vclick – kamesh Sep 11 '14 at 10:24
  • is '.open-mob-menu' being dynamically inserted by Javascript/jQuery as part of mobile detection? If so, [.click() won't work](http://stackoverflow.com/questions/6658752/jquery-click-event-doesnt-work-on-dynamically-generated-elements). Try .on('click', function(){}) instead. – Timmah Sep 11 '14 at 10:32

0 Answers0