Title: HTML code
Last modified: October 25, 2022

---

# HTML code

 *  Resolved [MasG](https://wordpress.org/support/users/dhevilz/)
 * (@dhevilz)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/html-code-35/)
 * <script>
    function update_columns() { jQuery(‘.cff-container-field>fieldset>div’).
   each(function () { var container = jQuery(this), visible = container.children(‘.
   fields:not(.cff-container-field):visible’).length; console.log(container); if(
   visible) container.find(‘.fields’).removeClass(‘column3 column4 column5 column6’).
   addClass(‘column’ + visible); }); } </script>
 * hello bro, I’m using above code to use flexible column size…
 * but there is one problem..
 * when I use hide class, the hidden class doesn’t become the same size immediately
   when opened..
 * for example, I opened into 4 columns by clicking the button “kepo”
 * then, when it reaches the 10th column then the hidden column will open automatically,
   but the default open doesn’t match the one above, can you help me?
 * this my videos
    check [in here](https://youtu.be/6MMiOR4286U)
 * i hope you can understand.. thx
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhtml-code-35%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/html-code-35/#post-16132693)
 * Hello [@dhevilz](https://wordpress.org/support/users/dhevilz/)
 * The solution would be to call the function you defined when the dependencies 
   vary too:
 *     ```
       <script>
       function update_columns() {
       jQuery('.cff-container-field>fieldset>div').each(function () {
       var container = jQuery(this),
       visible = container.children('.fields:not(.cff-container-field):visible').length;
       if (visible)
       container.find('.fields').removeClass('column3 column4 column5 column6').addClass('column' + visible);
       });
       }
   
       jQuery(document).on('showHideDepEvent', function(){update_columns();});
       </script>
       ```
   
 * Note that I included the following piece of code after defining the function:
 * `jQuery(document).on('showHideDepEvent', function(){update_columns();});`
 * Best regards.
 *  Thread Starter [MasG](https://wordpress.org/support/users/dhevilz/)
 * (@dhevilz)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/html-code-35/#post-16135664)
 * its work perfectly, thank you..

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HTML code’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [MasG](https://wordpress.org/support/users/dhevilz/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/html-code-35/#post-16135664)
 * Status: resolved