on the site I have three note cards. When clicked the one you selected slide to the right. If you click another card on the left the open card resets and the new card slides right. However, most of the time a double click is required to get the new card to slide to the right and the open card to slide left.
I think I got it. First, what you should do is reduce your code to just a couple of lines. That in itself can fix what is causing the bug. The more you simplify, the less chances of mistakes or little bugs.
I think that should be right but there might be a line in there that needs to be altered. Just maybe. Switch that out with the code inside notecards.js and tell me how that goes. Also, if it doesn’t go right, make sure my code isn’t missing a character somewhere.
Ok, with some critical thinking, I figured out what was the cause of the issue. Because you use toggle, you click on the card it opens, it’s setting up the next click to be the second part of the toggle. When you click on another card, it cancels the first toggle and doesn’t do anything. That’s why you need a second click to activate the new toggle. Below I combined your .stopPropagation() into one just for code reduction. But for the fix, I added a click function at the top of each of your toggles. That way, instead of just canceling the last toggle making you click again, clicking on another card will cancel the last toggle and start the new one in the same click. So copy paste the code and things should be dandy. Maybe. I don’t know if you still want the .stop() in there, I left it in just in case.
I’ll try the code when I get to work. However, the issue still happens even if you close the open card. So, even you do the second click on the open card you still have to double click the next card at times.