I am creating a script that will show drop down menus under my navigation items on a Desktop, Ipad or tablet.
Right now the dropdowns are showing when I test this on a desktop, but not on an Ipad.
I tried adding alerts to see if they show when I tap on the navigation items on an Ipad, and they did. So I'm wondering if there is an issue with ToggleClass on an Ipad?
Why does this code not work on an Ipad?
$('body').on('click touchstart','li.dropdown-control > a',function(event){
event.preventDefault()
var nextSibling = $(this).next();
nextSibling.toggleClass('dropped');
$('.dropped').not(nextSibling).removeClass('dropped');
});