mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-09-26 20:36:25 +00:00
Fix error when no masonry is found
This commit is contained in:
@@ -7,9 +7,12 @@ function resizeItem(masonry, item){
|
||||
|
||||
function resizeAll(){
|
||||
let masonry = document.getElementsByClassName("masonry")[0];
|
||||
|
||||
if (!masonry) return;
|
||||
|
||||
masonry.style.gridAutoRows = "20px"
|
||||
masonry.style.marginBottom = "80px"
|
||||
let allItems = document.getElementsByClassName("masonry-item");
|
||||
let allItems = masonry.getElementsByClassName("masonry-item");
|
||||
|
||||
for (const item of allItems) {
|
||||
resizeItem(masonry, item)
|
||||
|
||||
Reference in New Issue
Block a user