Simple jQuery accordion toggle
<p>I am working on a simple accordion with toggle states using jQuery. So far so good, but when I click on a different toggle than the initial one that I've clicked on at the start it toggles itself, leaving the previous one with the opened state.</p>

<p>How can one do some kind of a check-up to see if there is another one opened and toggle its state as well?</p>

<p>Here is a <a href="https://jsfiddle.net/cndnnww5/2/" rel="nofollow noreferrer"><strong>Fiddle.</strong></a> Just mess around with it for a few seconds and you will understand what I mean.</p>

<pre><code>// Accordion init
// Hide accordion content on load
$('.accordion-content').hide();
$('.widget-accordion').find('.accordion-toggle').click(function() {

  // State change visuals
  $(this).toggleClass('opened');

  //Expand or collapse this panel
 $(this).next().slideToggle('fast');

  //Hide the other panels
  $(".accordion-content").not($(this).next()).slideUp('fast');

});
</code></pre>