S
S
Sergey2019-03-05 11:49:26
JavaScript
Sergey, 2019-03-05 11:49:26

How to change pictures in another block when changing slide in owl carousel?

Foreword:
I am doing a layout landing on WordPress, using the ACF plugin for additional fields. For the slide, I have the following fields: Title, Description and Image. There are as many slides as possible. I'm using owl carousel for the slider.

Problem:
When changing a slide, the corresponding picture in another block should change. But my pictures are simply added in html one under the other and the pictures do not change, the picture that is higher in structure is simply shown.
5c7e380d0c646784767552.jpeg
5c7e3813be744482264967.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-03-05
@zoozag

owl.on('changed.owl.carousel', function(event) {
    ...
})

You can determine the current slide by the slide change callback and, depending on this, show the desired .header-bg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question