Bhaveshpp

Professional Magento Developr - Healp eachother to grow

Magento 2: js widget accordian

20 Jan 2022 » magento2, php

<div class="widget follow-us" data-action="accordion">
   <h3 class="widget-title" data-role="collapsible"  data-role="trigger">Síguenos en redes</h3>
   <div class="share-links" data-role="content">
      <a href="#" rel="nofollow" target="_blank" title="Facebook" class="share-facebook">Facebook</a>
      <a href="#" rel="nofollow" target="_blank" title="Twitter" class="share-twitter">Twitter</a>
      <a href="#" rel="nofollow" target="_blank" title="Instagram" class="share-youtube">Youtube</a>
   </div>
</div>
<script>
require(['jquery','slick','accordion', 'matchMedia'], function($)
 {
     mediaCheck({
         media: '(min-width: 768px)',
         entry: function () {},
         exit: function () {
            $("[data-action=accordion]").accordion({
             "collapsible": true,
             "multipleCollapsible": true,
            })
            $("[data-action=accordion]").accordion("deactivate");
         }
     })
   })
</script>

Thanks.