完成slideUp或slideDown后的触发事件

use*_*100 7 jquery

我正在对象上做一个简单的slideUp动画.我希望在动画完成后向元素添加属性标记.我怎样才能使这个工作?

if($(this).is(':visible')) {
  if(config.animate=='true')                    
    $(this).slideUp(options.animationTime);   //After animation ends do $(this).attr('shown','true');
  else 
    $(this).hide();             
}
Run Code Online (Sandbox Code Playgroud)

Dav*_*yen 12

$(this).slideUp(options.animationTime, function() {
    $(this).attr('shown','true');
}); 
Run Code Online (Sandbox Code Playgroud)