Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Make accordions closed by default

Similar to this on this one, instead of a button that collapses all of them. Just collapsed on default when the file is opened.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In the JS place the code $(".panel-collapse").collapse("hide"); above the "#accordion_search_bar" section. This way it will just tell the DOM to close all the panels

$(function() {
  var searchTerm, panelContainerId;
  // Create a new contains that is case insensitive
  $.expr[":"].containsCaseInsensitive = function(n, i, m) {
    return (
      jQuery(n)
        .text()
        .toUpperCase()
        .indexOf(m[3].toUpperCase()) >= 0
    );
  };
$(".panel-collapse").collapse("hide"); 
$("#accordion_search_bar").on("change keyup paste click", function() {
    searchTerm = $(this).val();
    $("#accordion > .panel").each(function() {
      panelContainerId = "#" + $(this).attr("id");
      $(
        panelContainerId + ":not(:containsCaseInsensitive(" + searchTerm + "))"
      ).hide();
      $(
        panelContainerId + ":containsCaseInsensitive(" + searchTerm + ")"
      ).show();
    });
  });

  $(".btn-expand-all").on("click", function() {
    $(".panel-collapse").collapse("show");
  });
  $(".btn-collapse-all").on("click", function() {
    $(".panel-collapse").collapse("hide");
  });
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!