在大型灯箱中自动播放(幻灯片)灯箱画廊? [英] Autoplay (slideshow) a lightbox gallery in magnific lightbox?
问题描述
我一直在寻找一种自适应灯箱,它将在图库中的指定点开始自动播放图库. Magnific Popup 看起来很坚固.任何人都可以将其用作灯箱幻灯片放映-也就是说,画廊是否可以自动前进?
I've been looking for a responsive lightbox that will autoplay a gallery starting at a specified point in the gallery. Magnific Popup looks pretty solid. Anyone have a way for it to act as a lightbox slideshow - that is, have the gallery autoadvance?
壮观的文档 magnificPopup.next();
,magnificPopup.updateItemHTML();
和/或回调事件的内容,但这超出了我的javascript
Looks from the Magnific documentation like there should be a way that makes use of magnificPopup.next();
, magnificPopup.updateItemHTML();
and/or callback events, but that's beyond my javascripting
谢谢!
如果您正在考虑"umm fancybox的autoPlay?",那肯定也可以.我仍然想尝试Magnific
edit: if you're thinking "umm fancybox's autoPlay?," sure, that would work also. I'd still like to try out Magnific
推荐答案
只需将间隔放在open
回调中.
Simply put interval in open
callback.
callbacks: {
open: {
setInterval(function() {
$.magnificPopup.instance.next();
}, 2000);
}
}
当然,这是非常基本的实现,但是您可以根据需要进行更多操作.
Of course it's very basic implementation, but you may go as far as you need.
这篇关于在大型灯箱中自动播放(幻灯片)灯箱画廊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!