Last active
May 24, 2020 04:50
-
-
Save williamromero/a292ca78ce7cd44be44edd6d4283ac2f to your computer and use it in GitHub Desktop.
Code Snippet to Filter by Brand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[filter-by="m&m"]').click(function(){ | |
var mix = $('.mix').children('.text-block-8'); | |
mix.each(function(index){ | |
if ($(this).text() === 'M&M') { | |
$(this).parent().show(); | |
} else { | |
$(this).parent().hide(); | |
} | |
}); | |
}); | |
$('a[filter-by="Sun Vibes"]').click(function(){ | |
var mix = $('.mix').children('.text-block-8'); | |
mix.each(function(index){ | |
if ($(this).text() === 'Sun Vibes') { | |
$(this).parent().show(); | |
} else { | |
$(this).parent().hide(); | |
} | |
}); | |
}); | |
$('a[filter-by="BeachBreak"]').click(function () { | |
var mix = $('.mix').children('.text-block-8'); | |
mix.each(function (index) { | |
if ($(this).text() === 'BeachBreak') { | |
$(this).parent().show(); | |
} else { | |
$(this).parent().hide(); | |
} | |
}); | |
}); | |
$('a[filter-by="boho"]').click(function () { | |
var mix = $('.mix').children('.text-block-8'); | |
mix.each(function (index) { | |
if ($(this).text() === 'boho') { | |
$(this).parent().show(); | |
} else { | |
$(this).parent().hide(); | |
} | |
}); | |
}); | |
// https://codepen.io/andrewbvsn/pen/yJOzXm?editors=1010 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment