Skip to content

Instantly share code, notes, and snippets.

@nkpznkpz
Created March 21, 2015 13:26
Show Gist options
  • Save nkpznkpz/e333388dc8d1b08eae3f to your computer and use it in GitHub Desktop.
Save nkpznkpz/e333388dc8d1b08eae3f to your computer and use it in GitHub Desktop.
var nextzy = {};
nextzy.checkAns = function(el) {
for (var i = 0; i < el.length - 1; i++) {
if ($((el)[i]).css("background-color") == $((el)[i + 1]).css(
"background-color")) {
nextzy.tmp = $((el)[i]);
} else {// if index 1 == index 2 diff is index 0
if (i == 0
&& $((el)[i + 1]).css("background-color") == $((el)[i + 2])
.css("background-color")) {
$((el)[0]).click();
}
$((el)[i + 1]).click();
}
}
}
nextzy.checkAns($("#box > span").get());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment