나는 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());
두 번째는 첫 번째보다 훨씬 빠릅니다. 이게 맞습니까? 아니면 어딘가에서 시험을 망쳤습니까?
무시했습니다. 명령이 저장됩니다. – gdoron