Answer the question
In order to leave comments, you need to log in
What is the correct name for such a function?
Hello. Tell me what is the name of such a function as partial hiding of elements and when you click on the button so that it opens completely, and then collapses. Or tell me where I can read about it. I don't know all the chips yet. But very interesting. I would be grateful for answers and tips.
Or can it be partially hidden by the height of the block, and when you click on the button, add a class to the block and only then set full visibility?
Answer the question
In order to leave comments, you need to log in
Yes, by adding a class, this is the simplest solution.
Add an id or data attribute to the wrapper block.
After the wrapper, add the "show more" block.
On "show more" we hang the listener on click.
On click will add a class with full height to the wrapper box,
and add another class to the "show more" box, with "display:none"
Small example
By analogy, you can add a "show less" box
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question