Answer the question
In order to leave comments, you need to log in
How to select a list item in an accordion to hide it and no error appears in the console?
Help, please, I've already broken my head. The site has a plugin for Joomla - Bootstrap Accordion Menu ( https://www.yireo.com/software/joomla-extensions/b... ). There are several levels in the menu, when the menu is closed, everything is great. When I open any tab, all submenus open. In the plugin itself, as I understand it, it is not implemented so that the submenus are hidden by default. Then plan B is to write a small script.
To begin with, I just wanted to hide the initially unnecessary uls, and later open them on onclick.
I wrote an elementary $('ul').hide();
thing, which the browser complained about "TypeError: Cannot read property 'hide' of null"
I climbed in the forums, came to the conclusion that the script works before loading everything else, then I wrote:
window.onload = function(){
$('ul').hide();
}
Answer the question
In order to leave comments, you need to log in
Initially, the plugin has a hide state, after loading you put hide again, that is, you do not change anything.
You need to add changes to the plugin so that they are hidden. Well, or a crutch, which is bad: by clicking on an item, I hide them.
First, show the html code for the menu.
Try
$(document).ready(function(){
$('ul').hide();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question