jQuery accordion open and close on click only
<p>HOw can I make sure that the accordion opens and close only when you click on h3?
As it stands when you click on any of the h3 it closes straight after.
See the code below:</p>

<pre><code>function accordion() {
    $('h3').click(function () {
        $('.box2').slideUp('normal');
        if ($(this).next().is(':hidden') == true) {
            $(this).next().slideDown('normal')
        }
    })
}
$(document).ready(function () {
    $(window).on("resize", function () {
        if ($(this).width() &lt; 480) {
            accordion();
        } else if ($(this).width() &gt; 480) {
            $('.box2').fadeIn(2000)
        }
    })
});
</code></pre>
