Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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