New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timers and AutoPlay #16
Comments
Nop, no one asked for that, although there are similar questions regarding the autoplay for the brother plugin fullPage.js. Basically you can achieve it by using the methods and callbacks provided by pagePiling.js: It is a very specific task that I believe shouldn't be in included in the plugin. The plugin offers the methods and callbacks to achieve it and the rest is left to the developer. var interval;
var autoPlayDuration = 1000;
$('#pagePiling').pagepiling({
sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
loopBottom: true,
afterLoad: function (anchorLink, index) {
clearInterval(interval);
setTimeout(function () {
interval = getInterval();
},autoPlayDuration);
},
afterRender: function () {
interval = getInterval();
}
});
function getInterval() {
return setInterval(function () {
$.fn.pagepiling.moveSectionDown();
}, autoPlayDuration);
} |
thanks for the code :) |
It doesn't work well and crashes after a little time. |
Live demo is working for me. You'll have to be a bit more specific and detail under what circumstances it breaks or what you really when by "it crashes". |
Thanks for your quick reply. It works for the first time. But when you click for navigation dots few times, the slides begin loop with very hight speed and sometimes break order. |
Yeah I see. I forgot to clear the timeout. See this demo: Code: var interval;
var timeout;
var autoPlayDuration = 1000;
$('#pagePiling').pagepiling({
sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
loopBottom: true,
afterLoad: function (anchorLink, index) {
clearInterval(interval);
clearTimeout(timeout);
timeout = setTimeout(function () {
interval = getInterval();
},autoPlayDuration);
},
afterRender: function () {
interval = getInterval();
}
});
function getInterval() {
return setInterval(function () {
$.fn.pagepiling.moveSectionDown();
}, autoPlayDuration);
} |
It'a AMAZING! Work perfect) |
Hello, alvarotrigo. |
Awesome library - thanks!
I was wondering if you have had anyone asking for an autoplay option? So basically you can get rid of the menu and let it play through the pile of pages automatically. If this is done, then you obviously need another option for autoplayDuration which is the amount of time it stays on each page before navigating to the next.
This can then be used in conjunction with the loop option to setup a fullpage slideshow of sorts that can be displayed on a monitor.
Further to this, you could setup different durations per page/section, so that you could have a video clip on a page that plays for 30 seconds and then moves onto the next page, while other pages only show for 10 seconds as they might only have static images.
Something like this:
The text was updated successfully, but these errors were encountered: