T
T
tommmm2017-11-14 11:33:44
JavaScript
tommmm, 2017-11-14 11:33:44

How to finalize the fullpage.js plugin?

There is a standard slider created by fullpage.js. The first slide is a video, after which the pictures are shown. When the slider returns to the first position, the video should not play. Now it continues to play.
It was possible to implement the launch of the slider after playing the video. Not good at js:
var video = document.getElementsByTagName('video')[0];
video.onended = function(e) {
$.fn.fullpage.moveSlideRight();
interval = setInterval(function() {
$.fn.fullpage.moveSlideRight();
}, 5000);
};
But I don't know how to restart the counter when clicking on the "fp-controlArrow" and "fp-slidesNav ul li a" buttons and how to turn off the video after the first play (before page refresh).
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-11-14
@webinar

No need to modify the slider, you just need to use its events and run the video on the activation event of the desired slide
https://github.com/alvarotrigo/fullPage.js#callbacks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question