Skip to content

Instantly share code, notes, and snippets.

@Adirael
Created January 22, 2014 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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