Close Slide-to-top Accordion from Codrops

I’ve built a Wordpress site using Codrops Slide-to-top Accordion.

My content is pretty long so if you want to close the accordion you have to scroll all the way up again to the header of that post.
I choose the one that had more than one open accordion because of height-calculation didn’t work on iPhone.

How can I make so click anywhere on the content also would close the accordion? Or a close-button at the end of the post?

View my test site

Thanks in advance!

[ot]Personally, I wouldn’t recommend a script like that, for a few reasons:

  • it makes the page very slow to load, so visitors may give up and leave
  • the functionality is a bit confusing, and it’s not clear where to click to get to the content
  • there is no content at all if JavaScript is disabled … which is a real sin.

Just saying … :slight_smile: [/ot]

Hi there,

I agree with what Ralph says, but if you want to make this work how you describe, I can help you.

So that I don’t have to wade through your code and work out what’s where, it would be good if you could make a minimal test page with a two-panel accordion on it (strip out all the unnecessary styles, content, JS etc) .

Let me know when you’ve done that and we’ll take it from there.