Skip to content

Instantly share code, notes, and snippets.

@bob-moore
Created January 15, 2016 15:05
Show Gist options
  • Save bob-moore/979708b5422cc5c4fa4b to your computer and use it in GitHub Desktop.
Save bob-moore/979708b5422cc5c4fa4b to your computer and use it in GitHub Desktop.
Hover Touch Menu THingy
jQuery( document ).ready(function($) {
'use strict';
if (!Modernizr.touch) {
return;
}
var link = $(menu_item).children( 'a' );
var sub_menu = $(menu_item).children( 'ul' );
$( link ).on( 'click', function( e ) {
if( $(sub_menu).css('visibility') == 'hidden' ) {
e.preventDefault();
$(this).blur();
} else {
return;
}
});
}
$.each( $( '.menu-item' ), function() {
var sub = $(this).children('ul');
if( sub.length ) {
touchDropDowns( this );
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment