Last active
August 29, 2015 14:04
-
-
Save the5fire/479b4a8c4b3d8323c65c to your computer and use it in GitHub Desktop.
color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://wbpkh5001.17c.cn/html5/ | |
function clock(){ | |
var color_map = {}; | |
var unfound = true; | |
var children = $('#box').children(); | |
var i = 0; | |
$.each(children, function(i, item){ | |
var key = $(item).attr('style'); | |
var nextkey = $(children[i+1]).attr('style'); | |
var v = color_map[key]; | |
console.log(key + ':' + v); | |
if (!jQuery.isEmptyObject(color_map) && v === undefined && key != nextkey) { | |
candidate = i; | |
$(item).click(); | |
unfound = false; | |
return false; | |
} | |
color_map[key] = 'exist'; | |
console.log('1'); | |
i++; | |
}); | |
if (unfound) { | |
$($('#box').children()[0]).click(); | |
} | |
} | |
setInterval('clock()', 600); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment