idleTime option for v4? #306
Answered
by
fancyapps
KrisGielen
asked this question in
Q&A
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
fancyapps
Jun 15, 2022
Replies: 1 comment 1 reply
-
Hi, Sorry, there is currently no built-in option for that, but it is on the to-do list. But you could easily create using API, here is a quick example: const Idle = {
timer: null,
set: () => {
Idle.timer = setTimeout(() => {
Fancybox.getInstance().$container.classList.add("is-idle");
}, 1000);
},
end: () => {
clearTimeout(Idle.timer);
Fancybox.getInstance().$container.classList.remove("is-idle");
},
};
Fancybox.bind('[data-fancybox="gallery"]', {
on: {
ready: (fancybox) => {
Idle.set();
fancybox.$container.addEventListener("mousemove", function (event) {
Idle.end();
Idle.set();
});
},
},
}); .fancybox__container[aria-hidden="false"].is-idle .fancybox__toolbar,
.fancybox__container[aria-hidden="false"].is-idle .fancybox__nav {
animation: 0.15s ease both fancybox-fadeOut;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
KrisGielen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Sorry, there is currently no built-in option for that, but it is on the to-do list. But you could easily create using API, here is a quick example:
.fancybox__container[