diff --git a/js/scripts.js b/js/scripts.js index 631bc9d..555ad3f 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -5,4 +5,14 @@ */ ( function( $ ) { $('.comment-metadata time').timeago(); + + /** + * Prevent changing location when clicking on a parent item on the main navigation. + */ + var is_touch_device = !! ( 'ontouchstart' in window ); + if ( is_touch_device ) { + $( '#site-navigation .menu-item-has-children > a' ).click( function( e ) { + e.preventDefault(); + } ); + } } )( jQuery );