N
N
Nikita Salnikov2021-07-15 17:55:54
Web development
Nikita Salnikov, 2021-07-15 17:55:54

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.
60f04c5ac5872522114483.jpeg

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

1 answer(s)
Q
qqNemo, 2021-07-15
@qqNemo

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 question

Ask a Question

731 491 924 answers to any question