Py学习  »  epascarello  »  全部回复
回复总数  2
7 年前
回复了 epascarello 创建的主题 » 多个悬停序列后JQuery setInterval不工作

您正在添加多个间隔。当你离开的时候你需要离开。也应该是个暂停,我怀疑你是否还想继续开火。

$('.presentation').on({
  mouseleave: function() {       
    this.timer = setTimeout(function () {}, 4000);
  },
  mouseenter: function() {
    if (this.timer) window.clearTimeout(this.timer)
  }
});

自从我使用数据表以来已经有一段时间了,但是您需要在加载页面时监听事件,然后才能初始化按钮

var table = $('#YourTable')

table.on('page.dt', function () {
  table.find('button').button()
});