【发布时间】:2018-10-04 21:48:34
【问题描述】:
以下函数显示计数。它在引导轮播中。
我想在引导轮播选择器有class="selected" 而不是在页面加载时立即启动此功能。
第二个条件应该是用户确实在页面的那个部分(#video)。因此,当他没有看到与功能相关的部分时(可能通过某种方式通过 scrollspy?),该功能不会启动。我该怎么做?
$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 4000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
关于此页面的问题(最后一张幻灯片):https://bm-translations.de/km#video
【问题讨论】:
-
你能解释更多
before AND if the user really is on that part of page吗? -
我编辑了问题
-
你能给我们一个你在jsfiddle(或任何其他平台)中的html代码的例子吗?谢谢
标签: jquery twitter-bootstrap carousel