Accordion using jquery

how to hide a panel inside an accordion created using jQuery?

js files:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="ui.core.js"></script>
<script type="text/javascript" src="ui.accordion.js"></script>

the code:

jQuery(document).ready(function() {

 $(document).ready(function() {

     $("#accordion").accordion();

 });

Needs:

According to the type of user input, the panel should hide (including the title).

Example:

In my example, there are three panels inside the accordion. Only I want to show two of them to the user. How to achieve this?

+3
source share
3 answers

Find your DOM element and call the hide function.

$("#myElementInsideAccordian").hide();
+1
source

, , , , true. , , false. jQuery Accordion documentation , .

,

$(document).ready(function(){
  $("#accordion").accordion( { active: false, collapsible: true });
});
+2

, . core :

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="ui.core.js"></script>
<script type="text/javascript" src="ui.accordion.js"></script>

, , , , , .

+1

Source: https://habr.com/ru/post/1728030/


All Articles