vCarousel/src/example.js

25 lines
868 B
JavaScript
Raw Normal View History

import { vCarousel } from "./vCarousel";
2021-04-01 17:20:09 +02:00
try {
2021-04-29 17:40:20 +02:00
var videosContainers = ["vFunanbule", "vForgeron", "vCircuit"];
var testvCarousel_1 = new vCarousel();
2021-04-29 17:40:20 +02:00
testvCarousel_1.vContainers = videosContainers;
if (window.location.hash !== undefined && window.location.hash !== "")
2021-04-29 17:40:20 +02:00
testvCarousel_1.firstVideoId = window.location.hash.replace("#", "");
testvCarousel_1.run();
2021-04-01 17:20:09 +02:00
var selectLinks = document.querySelectorAll(".selectVideo");
var _loop_1 = function (i) {
var link = selectLinks[i];
link.addEventListener("click", function (e) {
2021-04-29 17:40:20 +02:00
testvCarousel_1.firstVideoId = link.hash.replace("#", "");
testvCarousel_1.playFirstVideo = true;
2021-04-29 17:40:20 +02:00
testvCarousel_1.run();
2021-04-01 17:20:09 +02:00
});
};
for (var i = 0; i < selectLinks.length; i++) {
_loop_1(i);
}
}
catch (e) {
console.error(e);
}