Skip to content

Instantly share code, notes, and snippets.

@g0ddest
Created September 23, 2014 10:50
Show Gist options
  • Save g0ddest/64c924ed366d335f5cde to your computer and use it in GitHub Desktop.
Save g0ddest/64c924ed366d335f5cde to your computer and use it in GitHub Desktop.
var cheat = function(){
var styles = {};
$('#box span').each(function(index){
if ($(this).attr('style') in styles){
styles[$(this).attr('style')]['count'] += 1;
}else{
styles[$(this).attr('style')] = {'count': 1, 'o': $(this)};
}
});
$.each(styles, function(i){
if(this['count'] == 1){
this['o'].trigger("click");
window.setTimeout(function(){cheat()}, 10);
};
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment