Created
March 12, 2020 00:46
-
-
Save jetsloth/a413511694ac89e60782745e124d09de to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<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