Adding the Javascript
Last updated
Last updated
Open the file layout.js and add the following code to it
This JavaScript code adds a click event listener to each .category-link
element. When a user clicks on a category card, a popup appears with a message displaying the category name.
Go ahead and deploy this change and see your action happening live on the preview site.
Once successfully deployed it would look something like above when a category card is clicked. Up next, its time to bundle up everything and show some real data using Nunjucks.