Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

How do you slow down accordion collapse?

SITUATION:

When a user clicks on a "state... btn" I've coded into an accordion I'm trying to get that accordion to either "delay or slow down" on its collapse UP so the user can "see" the saving... or loading... states for at least a 1 sec or 2 before it closes.

i've tried to write the js but nothing has worked for me so far. i've also downloaded the collapsiblejs plugin for jquery but again my js is not very strong so i was not able to get it to work using the examples provided.

I could provide the code upon request via code pen etc.

thanks in advance :)

Mitch

5 Answers

Hey Mitch,

Could you provide the code?

Hi Calvin,

Thanks for responding.

Here's the code (via CodePen) as requested:

http://codepen.io/mitchfanning/pen/IBKbL

Click "Cell Phone" and "Add expense" to open the accordions.

Again, the idea is to slow down or delay the accordion from closing so that the user can simply see the "Save expense..." or "Add expense..." states (before they close).

Apologies up front for not using coding best practices, I'm relatively new at Front End dev and just trying to hack together a prototype in Bootstrap.

Thanks in advance.

Mitch

Hi Calvin

Thanks for responding.

Here's the code as requested.

http://codepen.io/mitchfanning/pen/IBKbL

Mitch

Hi Calvin

Thanks for responding.

Here's the code as requested.

http://codepen.io/mitchfanning/pen/IBKbL

Mitch

So for the duplicate responses...when i tried to submit my response the site seemed to be down?!?!? Anyways, thanks.