Skip to content

Conversation

@XiaohanSun416
Copy link

No description provided.

displayPhoto();
};

filterBtn[0].onclick = function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An improvement you can make: instead of using filterBtn[0] to set the click event listener, you should check the ID of the button element to get the type. Otherwise, if the order of the buttons gets changed, you wouldn't need to updated each of the click event functions. This would also allow you to have cleaner code, because you could create a more generic click event listener for all the buttons using a for loop.

@doradohunter
Copy link

This is looking good, but one minor thing you should look into fixing: after you select a filter, but then go back the "All" filter, the "Load more" button isn't shown anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants