Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
Accordion - All Closed by Default on Shopify page

I have a FAQ page on a Shopify site that features an accordion. All works fine with the exception that the first panel of the accordion is open by default and I would like all panels to be closed by default on load. Once it's loaded, the user can open all if they would like but that should be their choice. They seems to be managed by the following script but I figure out what to change/add/remove in order to have them all closed by default. Any ideas? I'd greatly appreciate it.

<script type="text/javascript">
window.addEventListener('load', function() {
    $("#{{section.id}} .panel-title").click(function() {
        $(this).toggleClass("active");
        $(this).next().slideToggle();
    }); 
   $("#{{section.id}} h4+.accordion-body .panel-title").addClass("active");
});
</script>

The HTML:

<div id="{{section.id}}" class="accordion-list">                        
        {% for block in section.blocks limit: section.blocks.size%}                 
          {% if block.type == 'accordion_title' and block.settings.sectiontitle != blank %}
            <h4>{{block.settings.sectiontitle}}</h4>
          {% endif %}    
          {% if block.type == 'accordion' %}
          <div class="accordion-body">
            <h5 class="panel-title fl f-jcsb j-aic">{{ block.settings.question}}<i class="ad ad-plus-l"></i></h5>
            <div id="{{ block.id }}" class="panel-content">{{ block.settings.answer}}</div>
          </div>
          {% endif %}
        {% endfor %}
      </div>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda