I created a menu so when the user hovers over a main menu item, a feature image below the menu will change. This works. I set up similar jQuery to accommodate touchscreens using click rather than hover, and this does not work.
The gist of my code... First I test if a touch device. If yes,
jQuery(document).ready(function(){
jQuery('.menu-item-1').on('click', function(){
jQuery('#feature-image').attr('src', 'http://jdaviswebdesign.com/education/wp-content/uploads/menu-image1.jpg');
});
jQuery('.menu-item-2').on('click', function(){
jQuery('#feature-image').attr('src', 'http://jdaviswebdesign.com/education/wp-content/uploads/menu-image2.jpg');
});
...repeated for each main menu li
I created a dummy page that can be viewed here (http://www.jdaviswebdesign.com/menu.html). The dummy page includes the CSS, jQuery, and HTML.
Any help or ideas would be much appreciated. I have tried every combination of writing the click function to no avail.