【发布时间】:2012-01-31 12:11:26
【问题描述】:
我已经完成了a test 的 jQuery 选择器性能。
我测试过的两个选择器:
selection_width = total_width - ($('#commands .minimap').outerWidth() + $('#commands .actions').outerWidth());
还有:
var commands = $('#commands');
selection_width = total_width - ($('.minimap', commands).outerWidth() + $('.actions', commands).outerWidth());
第二个比第一个快得多。这是正确的还是我在某个地方搞砸了测试?
【问题讨论】:
标签: jquery performance