我可以加快这个算法吗?下面使用的 mootools javascript 库?
var selected = '',
slaves = $$('input[name^="product[photos][attach][]"]');
slaves.addEvent("change", function () {
selected = parseInt(this.get('value'));
slaves.each(function(el){
if (selected != parseInt(el.get('value'))) {
el.getParent('div').addClass('hidden');
el.checked = false;
}
});
});
谢谢!