Skip to content

Instantly share code, notes, and snippets.

@adam8810
Created September 20, 2012 16:33
Show Gist options
  • Save adam8810/3756941 to your computer and use it in GitHub Desktop.
Save adam8810/3756941 to your computer and use it in GitHub Desktop.
$(data.cast).each(function($index)
{
// Set defaults
$profile_path = "/assets/img/missing_" + (($index % 5) + 1) + ".png";
$position_offsets = "";
// Check to see if image exists
if(this.profile_path != null)
{
$profile_path = "http://cf2.imgobject.com/t/p/w185" + this.profile_path;
$position_offsets = "-20px -40px";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment