Custom Accordion with arrows

微笑、不失礼 提交于 2019-12-11 20:38:46

问题


I have a custom accordion with the following code;

$('h2.expand').next('div').not(':first').hide()
    $('h2.expand').click(function () {

        $(this).next('div').toggle();
        $(this).toggleClass('active');

    });

and markup

<h2 class="expand">Your ASC</h2>
<div>
...
</div>

On page load the first div is open, but the arrowhead is in the closed position (pointing right).

However I have a small problem, whereby the arrowhead on the first div is in the closed position and in the open position when the accordion is closed, essentially the reverse of what I want..!

How can I edit my code so the arrowhead turns to the right when the h2.expand is clicked?

Thanks in advance..

来源:https://stackoverflow.com/questions/10950489/custom-accordion-with-arrows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!