• Resolved MasG

    (@dhevilz)


    <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

    i hope you can understand.. thx

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @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

    (@dhevilz)

    its work perfectly, thank you..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML code’ is closed to new replies.