【发布时间】:2017-01-27 10:32:00
【问题描述】:
js,我想在鼠标悬停在 h1 标签时暂停滑块,但它没有,我知道这是 javascript 的问题,但我无法让它工作
http://jsfiddle.net/2dhkR/405/
$(document).ready(function() {
$('#fullpage').fullpage({
sectionsColor: ['#1bbc9b', '#4BBFC3'],
loopBottom: true,
afterRender: function() {
setInterval(function() {
$.fn.fullpage.moveSlideRight();
}, 3000);
}
});
// the function - set var up just in case
// the timer isn't running yet
var timer = null;
function startSetInterval() {
timer = setInterval(showDiv, 5000);
}
// start function on page load
startSetInterval();
// hover behaviour
function showDiv() {
$('#fullpage h1').hover(function() {
clearInterval(timer);
}, function() {
startSetInterval();
});
}
});
任何帮助将不胜感激,谢谢
【问题讨论】:
标签: javascript setinterval fullpage.js