地址:http://www.webhek.com/color-test
setInterval(function () { var $box_container = $('#room #box:visible'); if ($box_container.length > 0) { var $boxes = $box_container.children('span'); $boxes.each(function () { var $self = $(this); var _st = $self.attr('style'); var _c = $boxes.filter('[style="' + _st + '"]').length; if (_c === 1) { $self.click(); return false; } }); }}, 500);
运行结果图