I'm developing smartphone hybrid applications.
I'm trying to hide/show a <div>
with slideDown
/slideUp
.
When I click on the button, the menu <div>
is supposed to hide/show depend of the context. Everything is working well on my computer but it just doesn't work at all on my mobile, nothing happens.
Here is my HTML code
<a class="btnMenuDyn" data-role="button">Masquer le menu</a>
and here my jQuery mobile code:
$(document).bind('pageinit', function(e){
// définition des variables
var btnMenuDyn = $('a.btnMenuDyn'),
menuDyn = $('div.menuDyn');
$(btnMenuDyn).bind('click', function(){
// condition pour afficher ou non le menu
if ($(menuDyn).hasClass("menuDynHide"))
{
$(menuDyn).slideDown().removeClass("menuDynHide");
}
else{
$(menuDyn).slideUp().addClass("menuDynHide");
}
});
});