停止jQueryUI效果

时间:2013-09-02 13:42:53

标签: jquery jquery-ui

我正在开发类似Facebook的聊天。当新消息到达时,我使用了jQuery UI高亮效果。现在我想在用户点击窗口时停止此效果。

这是关于窗口点击事件的代码。 “janela”课程是聊天窗口。

$('.janela').live('click', function(){
    var id = $(this).children('.topo').attr('id');
    $.post('sys/chat.php',{acao: 'mudar_status', user: id});
    $(".topo").effect("none"); //it's just a frustrated try.
});

感谢。

2 个答案:

答案 0 :(得分:0)

使用stop:

$(".topo").stop(true, true)

正如我的评论中所述,live已被弃用,请使用on

答案 1 :(得分:0)

使用.stop(),它会停止匹配元素上当前正在运行的动画。

$(".topo").stop(true, true);