FlipClock.js 倒计时结束时显示图像
FlipClock.js display an image when the countdown is over
我正在使用 FlipClock 1.1a,我想在倒计时结束时设置一个图像并隐藏计数器。目前,当时间到了时,计数器进入 - 时间(-1 小时,-12 分钟)。我怎样才能做到这一点?该网站的回调很少,没有帮助。
他们在代码库中提供了不同的示例,其中确实包括计数器停止事件。因此,您需要使用 FlipClock 的 stop
回调执行所需的操作,
var clock;
$(document).ready(function() {
clock = $('.clock').FlipClock(10, {
clockFace: 'MinuteCounter',
countdown: true,
callbacks: {
stop: function() {
// Do whatever you want to do here,
// that may include hiding the clock
// or displaying the image you mentioned
$('.message').html('The clock has stopped!');
}
}
});
});
P.S
如果您已经下载了他们的整个源文件,您可以查看演示本身 /FlipClock-master/examples/countdown-stop-callback.html
我正在使用 FlipClock 1.1a,我想在倒计时结束时设置一个图像并隐藏计数器。目前,当时间到了时,计数器进入 - 时间(-1 小时,-12 分钟)。我怎样才能做到这一点?该网站的回调很少,没有帮助。
他们在代码库中提供了不同的示例,其中确实包括计数器停止事件。因此,您需要使用 FlipClock 的 stop
回调执行所需的操作,
var clock;
$(document).ready(function() {
clock = $('.clock').FlipClock(10, {
clockFace: 'MinuteCounter',
countdown: true,
callbacks: {
stop: function() {
// Do whatever you want to do here,
// that may include hiding the clock
// or displaying the image you mentioned
$('.message').html('The clock has stopped!');
}
}
});
});
P.S
如果您已经下载了他们的整个源文件,您可以查看演示本身 /FlipClock-master/examples/countdown-stop-callback.html