Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Fully responsive with SASS, BEM and vanilla JavaScript

Maciej Walecki• 110

@maciekw129

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I would be grateful for any feedback ;)

Community feedback

Raymart Pamplona• 16,090

@pikapikamart

Posted

Hey, great work on this one. The layout is really good and it resizes well when going in mobile state.

But a problem is that, at first the accordion is working. But after a while I get the same error as pointed by @mbart13 and your accordion does not work anymore and prompting errors.

But when I click the arrow img, the accordion works, but clicking the question the error is prompted.

Tried reloading a bunch, then your accordion now works. That seems really strange.

Okay, so it works now. But clicking multiple accordion resizes the whole container. Though it is fine but for me, I want to prevent that. It will be awesome if you could cap the container of it.

So to do that, you could add a max-height and overflow-y: scroll. This way, even if a user clicks multiple accordion, it will not resize the container itself because the article will prevent the element overlapping the max-height and you can just scroll on it. This for the desktop state.

But by doing so, there will be a scrollbar right. You could get rid of that by simple adding

.example::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.example {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

this, just change the selector. This will remove the scrollbar but keeps its functionality

Overall, your work is really good^^

0

Maciej Walecki• 110

@maciekw129

Posted

@pikamart Hey, Thank you very much for all of the advices. I have added max-height and scroll, and it really works better ;)

0
Michal• 665

@mbart13

Posted

Hi Maciej, one problem I found is when I click on the field next to the question I'm getting errors in console "TypeError: answer is null"

0

Maciej Walecki• 110

@maciekw129

Posted

@mbart13 I didn't notice that, thank's for pointing that out. I'm going to fix ;)

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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