Last active
August 29, 2015 14:07
-
-
Save chadsten/566384481d4f16946d83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If component already has a slice | |
if(componentArray[i].hasOwnProperty('slice')){ | |
// Fade out current slice | |
componentArray[i].slice.fadeOut(200,function(){ | |
// Swipe slice source | |
this.src = '/sites/default/files/generated_image/' + view + '_' + component_id + '-' + swatch_id + '.png'; | |
// Fade back in | |
jQuery(this).fadeIn(200); | |
}); | |
} else { | |
// Create new slice | |
componentArray[i].slice = jQuery('<img src="/sites/default/files/generated_image/' + view + '_' + component_id + '-' + swatch_id + '.png" style="position: absolute; z-index: ' + i+2 + '; top: 0; left: 0;">'); | |
// Append to dom and fade in | |
componentArray[i].slice.hide().appendTo(boat_container).fadeIn(200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment