First of all, I know this has been answered a lot of times, but all the things I try to do, they're not working. So here's my problem:
I have a non-displayed div that I want to show when the users clicks a div, so I have this javascript code:
$(document).ready(function() {
$(.hamburger-menu).on(click, function(){
var display = $(.menu-mobile).css(display);
if (display == none) {
$(.menu-mobile).css(display, block);
} else {
$(.menu-mobile).css(display, none);
}
});
});
This works perfectly on my desktop but doesn't work in my mobile.
What I found in the other answers was to change the .on(click) value to .on(click touchstart) or .on(tap), but they both don't work.
So what's the problem? I have another animation that doesn't require any click event and it works perfectly and smoothly on my mobile. Could anyone help me?
Thanks.