Last active
May 7, 2020 07:11
-
-
Save michelmany/8fd208a37d045f6826ebd5f6024e4899 to your computer and use it in GitHub Desktop.
Init Isotope Layout JS with ES6 ( https://isotope.metafizzy.co/ )
This file contains hidden or 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
const grid = document.querySelector(".sorteios__grid-items"); | |
const gridFilterButtons = document.querySelectorAll(".sorteios__grid-filter button"); | |
const iso = new Isotope(grid, { | |
itemSelector: ".sorteios__grid-item", | |
masonry: { | |
gutter: 10, | |
}, | |
}); | |
gridFilterButtons.forEach((filterButton) => { | |
filterButton.addEventListener("click", () => | |
iso.arrange({ filter: filterButton.dataset.filter }) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment