Jquery Touchstart & Click Question
Hi all
I have two functions below. One detects of the user has "clicked" a menu item and one is if a user "touches" the menu item.
The "click" function is working perfectly. The "touch" version doesn't show or hide my html. I can alert() the ID in the touch event so I know im capturing the "touch" but the hiding/showing of content simply does not work.
Any thoughts as they are the same function in all essence? Its got me stumped.
- // click the link
$('body').on('mouseenter', '[id^="showmenu_"]', function(e){
e.preventDefault();
var itemid = this.id.split("_")[1];
//alert(itemid);
$("#dynamic-submenu ul:not(#models_"+itemid).hide();
$("#models_"+itemid).show();
});
// touch the link
$('body').on('touchstart', '[id^="showmenu_"]', function(e){
e.preventDefault();
var itemid = this.id.split("_")[1];
//alert(itemid);
$("#dynamic-submenu ul:not(#models_"+itemid).hide();
$("#models_"+itemid).show();
});