Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script type="text/javascript">
jQuery(document).bind('gform_post_render', function(e, formId, currentFormPage) {
var $form = jQuery('#gform_' + formId);
$form.find(".gform_body li.preview-area img" ).css('display','none');
$form.find(".gform_body li.preview-area .demo-product:eq(0)" ).css('display','block');
$form.find(".gform_body li.preview-area .demo-artwork:eq(1)" ).css('display','block');
// On color swatch click/secltion
$form.find("li.color-picker-choice " ).click(function() {
var $radioIndex = $form.find("li.color-picker-choice ").index(this);
var $imageRef = $form.find(".gform_body li.preview-area .demo-product");
$imageRef.css("display","none");
$imageRef.eq( $radioIndex ).css("display","block");
});
// On image choice click/secltion
$form.find("li.image-choices-choice" ).click(function() {
var $choiceIndex = $form.find( "li.image-choices-choice").index(this);
var $choiceImageRef = $form.find( ".gform_body li.preview-area .demo-artwork");
$choiceImageRef.css("display","none");
$choiceImageRef.eq( $choiceIndex ).css("display","block");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment