A
A
Azat Tagaev2019-02-20 15:28:55
JavaScript
Azat Tagaev, 2019-02-20 15:28:55

Need help with jQuery in carousel?

Hello! Please tell me what is this?
5c6d453f825d2995065583.jpeg
There is such a carousel as in the picture. The carousel and video are not the problem, but the problem is JQ. Since I'm not strong in it, I'll forgive the help!
Here's what you need:

Slider

div class="slider"
     a href="путь к видео-1" class="video-1">Сдержимое</a<br>
     a href="путь к видео-2" class="video-2">Сдержимое</a<br>
    a href="путь к видео-3" class="video-3">Сдержимое</a<br>
     a href="путь к видео-4" class="video-4">Сдержимое</a<br>
     a href="путь к видео-5" class="video-5">Сдержимое</a<br>
/div

div class="video"
      Блок с выводом видео
/div


So, it is necessary that when you click on the link in the carousel, in the block with the video, the path to the video is written and launched without reloading the page. And showed the active video in the carousel!
You need JQ or JS code.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ragtime Kitty, 2019-02-20
@Borsok

$("a").click(function(event) {
    event.preventDefault();
    target = $(this).attr('href');
    $("video").attr("src", target);
});

Highlight active video in the carousel with a class

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question