Skip to content

Instantly share code, notes, and snippets.

@yuchant
Created May 19, 2014 16:54
Show Gist options
  • Save yuchant/a1096861fab1c07579f5 to your computer and use it in GitHub Desktop.
Save yuchant/a1096861fab1c07579f5 to your computer and use it in GitHub Desktop.
var fitPhotoTargetSelector = name + " .fittingbox-fitphoto-target";
window.fitPhoto = FitPhoto.create(fitPhotoTargetSelector, {
width: 327,
glassID: glassID,
localeChain: 'en_US'
});
// handle change sku
$actionContainer.find('.fittingbox-sku').unbind('click').click(function() {
var sku = $(this).data('sku');
window.fitPhoto.tryOn(sku);
})
// upon closing the window, call removal function and remove the element.
destructFunc = function() {
console.log('removing fitphoto');
$template.remove();
window.fitPhoto.remove();
window.fitPhoto = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment