Skip to content

Instantly share code, notes, and snippets.

@chrdesigner
Created September 17, 2018 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrdesigner/ab8bcea179832ae6e560145559d09bbd to your computer and use it in GitHub Desktop.
Save chrdesigner/ab8bcea179832ae6e560145559d09bbd to your computer and use it in GitHub Desktop.
Sub Menu + Filter TAG ~ Simple
$('.filterBlog').on('click', 'a', function(e){
e.preventDefault();
var hash = $(this).attr('href').replace(/^.*?(#|$)/,'');
$('.filter a.type').each(function (index, value) {
// console.log('filter' + index + ':' + $(this).attr('id'));
if(hash === $(this).attr('id')){
$(this).get(0).click();
// console.log('return current ID' + ' : ' + $(this).attr('id'));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment