W
W
WebforSelf2020-04-23 17:57:42
JavaScript
WebforSelf, 2020-04-23 17:57:42

How to copy block from active jquery slider?

There is a slider

<a href="/" class="b-carousel-item zhk-item slider-item swiper-slide-active">		
    <div class="b-carousel-title">тест1</div>
            </div></a>

      <a href="/" class="b-carousel-item zhk-item slider-item">		
    <div class="b-carousel-title">тест1</div>
            </div></a>

      <a href="/" class="b-carousel-item zhk-item slider-item">		
    <div id="title">тест1</div>
            </div></a>


the swiper-slide-active class is the active slide that is being toggled.

We need to find the block with id =title at the active slider and copy its value to

id=title1 , title1 will be static under the slider. When switching the slider automatically or manually, the content is copied.
swiper slider

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sharomet, 2020-04-23
@sharomet

In general, one page should not have the same id. and you have id="title" in each slide. replace with class

Ваше событие.function() {
$('#title1').text($('.swiper-slide-active #title').text());
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question