Responsive Ecommerce Product Page With Lightbox
Design comparison
Solution retrospective
I would love to learn about ways to reduce having so many JavaScript event handlers for all the interactions in this challenge and whether having so many can cause performance issues.
Any additional feedback is also appreciated and welcomed!
Community feedback
- @renrasPosted almost 3 years ago
You can look into using event delegation where you put an event listener only to the parent.
Too much event listeners are only bad depending on the function inside it. Most of your functions run in O(n) time or less which is good.
Marked as helpful1@SheGeeksPosted almost 3 years ago@renras I will look into using event delegation for the quantity buttons and lightbox navigation icons. That will hopefully remove two or more listeners from my code.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord