vfontjr icon

Toggle_form_sections

vfontjr | PRO | 12/13/22 01:00:15 PM UTC | 0 ⭐ | 1067 👁️ | Never ⏰ | []
JavaScript |

880 B

|

Source Code

|

0 👍

/

0 👎

<script>
jQuery(document).ready(function($) {
    "use strict";
 
    /* Registration credentials initally open */
    $("#frm_field_336_container > .frm_toggle_container").show()
 
    /* toggle open sections when another section is selected */
    $("h3.frm_pos_top.frm_section_spacing.frm_trigger").on("click", function( ev ) {
        var show_current = $(this).data('section'),
            section_h3_id = '#' + $(this).prop('id');
        $("h3.frm_pos_top.frm_section_spacing.frm_trigger").each(function(){
            if ( $(this).data('section') !== show_current ) {
                if ( $(this).hasClass('active') ) {
                    $(this).trigger("click");
                }
                $("div#" + $(this).data('section') + "_container > div.frm_toggle_container").hide();
            }
        })
        scrollToSection(section_h3_id);
    });
});
</script>

Comments