G
G
godsplane2020-04-27 13:59:55
JavaScript
godsplane, 2020-04-27 13:59:55

How to call a function only in relation to the child general button block?

5ea6ba2438bad715092296.png

There is a list of blocks with a class documents_blockinside each of them there is a button with a class open-doc-listthat opens when clicked. documents-content
But now all blocks open on an event, how to make the event individual for each block? I hope you understand what I mean.

code pen

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-04-27
@godsplane

$('.open-doc-list').click(function() {
  $(this)
    .find('.img-block')
    .toggleClass('arrow_up')
    .closest('.documents_block')
    .find('.documents-content')
    .slideToggle(300);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question