문제

If anyone can help me with how to close active accordion of layered navigation if clicked outside the layered navigation block?

 <div class="filter-options" id="narrow-by-list" data-role="content" data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": false, "multipleCollapsible": false}}'>

this is the default accordion which is collapsible.

올바른 솔루션이 없습니다

다른 팁

Got the solution. Create a new js file and include it or edit any theme js file. Add below code.

/*Close Layered Navigation on side click*/
$(document).click(function(e) {
    if (!$( "#narrow-by-list" ).is(e.target) && !$( "#narrow-by-list" ).has(e.target).length) {
        $(".filter-options-item").collapsible("deactivate");
    }
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top