Discuss / JavaScript / 作业

作业

Topic source

HypErGlorY

#12 Created at ... [Delete] [Delete and Lock User]

箭头函数要这样才可以

tr.fadeOut('slow',() => tr.remove());

楼上用this甚至$this[你别逗我] 你看到的只是动画效果,实际tr标签并没有被移除,因为这个this是词法作用域的

回调函数中,this已经是jquery对象了,所以没有必要再次$符号处理。


tr.fadeOut('slow', function(){this.remove();})

  • 1
  • 2

Reply