Advertisement
vfontjr

Toggle_form_sections

Dec 13th, 2022
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.88 KB | Source Code | 0 0
  1. <script>
  2. jQuery(document).ready(function($) {
  3.     "use strict";
  4.  
  5.     /* Registration credentials initally open */
  6.     $("#frm_field_336_container > .frm_toggle_container").show()
  7.  
  8.     /* toggle open sections when another section is selected */
  9.     $("h3.frm_pos_top.frm_section_spacing.frm_trigger").on("click", function( ev ) {
  10.         var show_current = $(this).data('section'),
  11.             section_h3_id = '#' + $(this).prop('id');
  12.         $("h3.frm_pos_top.frm_section_spacing.frm_trigger").each(function(){
  13.             if ( $(this).data('section') !== show_current ) {
  14.                 if ( $(this).hasClass('active') ) {
  15.                     $(this).trigger("click");
  16.                 }
  17.                 $("div#" + $(this).data('section') + "_container > div.frm_toggle_container").hide();
  18.             }
  19.         })
  20.         scrollToSection(section_h3_id);
  21.     });
  22. });
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement