Skip to content

Instantly share code, notes, and snippets.

@Adirael
Created January 22, 2014 12:36
Show Gist options
  • Save Adirael/8558006 to your computer and use it in GitHub Desktop.
Save Adirael/8558006 to your computer and use it in GitHub Desktop.
var vertical = 0;
var horizontal = 0;
var cuadrada = 0;
jQuery('div.play').each(
function(index, Element){
if(jQuery(Element).width() > jQuery(Element).height()){
horizontal = horizontal + 1;
} else if (jQuery(Element).width() < jQuery(Element).height()) {
vertical = vertical + 1;
} else {
cuadrada = cuadrada +1;
}
}
);
console.log('Totales: ' + jQuery('div.play').length + ', Horizontales: ' + horizontal + ', Verticales: ' + vertical + ', Cuadradas: ' + cuadrada);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment