Answer the question
In order to leave comments, you need to log in
How to create carousel with preloader and fake API?
Hello!
please tell me how you can simulate loading from the REST API as in the picture
, I basically created a carousel, but I don’t understand how to simulate loading other cards.
when you click on the button, I want a fake loading with some kind of loader to take place and then the next slide
code is shown below, I redid it a bit, and here the slider is of course not working, since the second day of testing I spend
pictures, I take random ones from the Internet
, here is my code
<body>
<h1>Carousel</h1>
<div id="my-carousel"></div>
<script>
var option1 = {
container: "my-carousel",
title: "Fresh and just upload content",
subtitle: "Lorem ipsum",
fetchCards: function(chunkSize) {
// здесь пытаюсь сделать так чтобы функция chunksize взращала обект с карточками
//каторая будет показана в каруселе
// вот так я хочу разделить каждую карточку
return {
image: "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg",
type: "learning",
duration: 3600,
title: "welcome",
cardinality: "single"
};
}
}
var carousel1 = new Carousel(options1);
</script>
</body>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question