- This topic is empty.
September 8, 2017 at 6:26 pm #259822leemii17Participant
I am trying to make the accordion show up but it won’t.
here is the link to my CodePen:
I can’t find the errorSeptember 9, 2017 at 12:09 am #259824BeverleyhParticipant
Might have something to do with the malformed table structure which I think is what’s causing
nextElementSiblingto return as
null. You shouldn’t have a div as a direct child of tr.
If you enclose the .panel div inside the .accordion td (and yes, you’ll need to fix the way it looks in the CSS), you could then change your JS from this;
var panel = this.nextElementSibling;
var panel = this.children;September 12, 2017 at 6:34 pm #259950leemii17Participant
can you show me how to enclose the .panel div inside .accordion?
I am a beginner.September 12, 2017 at 10:10 pm #259951BeverleyhParticipant
It just means that you should put the
divelements inside the
tdelement. Read this for more info and examples https://css-tricks.com/using-divs-inside-tables/
However, if you’re a beginner with the basics of HTML, you’ll really have some work cut out for yourself when it comes to fixing the CSS.
Then again, you might be able to accept the resulting visual affects after this change, but if you can’t, you’ll need to research and learn more about CSS, or consider hiring somebody to do the work for you. Unfortunately, we aren’t here to do your work for you.September 12, 2017 at 11:36 pm #259952
- The forum ‘Design’ is closed to new topics and replies.