Skip to content

Instantly share code, notes, and snippets.

@vbarinov
Last active August 29, 2015 14:27
Show Gist options
  • Save vbarinov/e4f321a0832c21cf6f45 to your computer and use it in GitHub Desktop.
Save vbarinov/e4f321a0832c21cf6f45 to your computer and use it in GitHub Desktop.
javascript:window.setInterval(function(){var c=$("#box span:first-child").css("background-color"),o=$("#box span:nth-child(2)").css("background-color");c!=o&&$("#box span:first-child").click(),$("#box span").each(function(){var o=$(this).css("background-color");return c!=o?($(this).click(),!1):void(c=o)})},10);
window.setInterval(function() {
var firstCol = $('#box span:first-child').css('background-color');
var secondCol = $('#box span:nth-child(2)').css('background-color');
if (firstCol != secondCol) {
$('#box span:first-child').click();
}
$('#box span').each(function(i) {
var curCol = $(this).css('background-color');
if (firstCol != curCol) {
$(this).click();
return false;
}
firstCol = curCol;
});
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment