【问题标题】:The function in jquery "queue" method could be executed only once?jquery "queue" 方法中的函数只能执行一次?
【发布时间】:2012-03-31 06:11:17
【问题描述】:

这是我的 jquery 代码:

       $('input').click(function(){
            $('h1').empty().queue(function(){
                console.log('queue');
            });
       });
    });

只有第一次点击输入时,萤火虫才会显示'queue'

但是当我第二次点击它时,它没有显示任何东西,我怎样才能在点击事件中多次执行队列方法?

【问题讨论】:

    标签: jquery queue


    【解决方案1】:
    $('input').click(function()
    {
        $('h1').empty().queue(function()
        {
            alert('queue');
            $(this).dequeue();
        });
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-22
      • 1970-01-01
      相关资源
      最近更新 更多