Javascript 在间隔中使用jQuery Glow

Javascript 在间隔中使用jQuery Glow,javascript,jquery,asp.net,jquery-plugins,Javascript,Jquery,Asp.net,Jquery Plugins,我想在我的页面中使用 我希望我的文字每4秒闪烁一次。我写了这段代码,但它不起作用 $(document).ready(function () { $('.white').addGlow({ textColor: 'white', haloColor: '#aaa', radius: 100 }); setInterval(function () { $('.white').mouseenter(); setTimeo

我想在我的页面中使用

我希望我的文字每4秒闪烁一次。我写了这段代码,但它不起作用

$(document).ready(function () {
        $('.white').addGlow({ textColor: 'white', haloColor: '#aaa', radius: 100 });
        setInterval(function () {
            $('.white').mouseenter();
            setTimeout(function () { }, 2000);
            $('.white').mouseleave();
        }, 2000);
    }); 
我怎么能做到


谢谢

尽管我不喜欢在插件不提供api的情况下假装效果(这意味着在jquery发光插件中不可能触发发光),但这里有一个可能的解决方案:

或具有以下参数:


你希望它在悬停时开始闪烁,对吗?不,我希望它自动开始
(function loop() {
  $('.green').mouseover();
  setTimeout(function () {
    $('.green').mouseout();
    setTimeout(loop, 2000);
  }, 2000);
}());
(function loop(el, delay) {
  el.mouseover();
  setTimeout(function () {
    el.mouseout();
    setTimeout(function () {
      loop(el, delay);
    }, delay);
  }, delay);
}($('.green'), 2000));