从jQuery 3.4:eq
开始不推荐使用,而.eq()
应该使用。
这是一个代码片段,其中包含多个正在使用的jQuery选择器:eq
。如何中断多个选择器.eq()
而不是使用:eq
?
$(this).find('th.draggable:visible:eq(' + n + ') span,td:visible:eq(' + (g.actionSpan + n) + ') span'));
使用add()这样的东西
const $th = $('th.draggable:visible',this).eq(n);
const $td = $('td:visible',this).eq(g.actionSpan + n);
const $spans = $('span',$th).add('span',$td)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句