I have a problem with touchstart event in my project . I have a menu icon and I'm doing the fallowing
$('.dashboard-menu').on('click', function(event) {
event.preventDefault();
//event.stopPropagation();
$(this).toggleClass('expanded');
$('.menu-state-icon').toggleClass('active');
});
This works fine on desktop version , but when I open page on iPhone I have a small "delay" , so I added
$('.dashboard-menu').on('click touchstart', function(event) {
event.preventDefault();
//event.stopPropagation();
$(this).toggleClass('expanded');
$('.menu-state-icon').toggleClass('active');
});
Now menu is opening faster but I can't click on menu items when I try to click on the "li" element menu close . Does anyone knows why is this happening ?
Here is the link http://djordjepetrovic.rs/touchstart/ (Menu on the center header div)