Skip to content

Instantly share code, notes, and snippets.

@istro
Created January 29, 2013 19:32
Show Gist options
  • Save istro/4666953 to your computer and use it in GitHub Desktop.
Save istro/4666953 to your computer and use it in GitHub Desktop.
for(var i = 1; i < number_of_banners; i++ ){
var banner = creativeList[i];
if(Math.abs((client.height+client.width)-(banner.height+banner.width)) < Math.abs((client.height+client.width)-(chosen_banner.height+chosen_banner.width)) && Math.abs(banner.ratio-client.optimal_ratio) < 0.3 ){
chosen_banner = banner;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment