Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1244489

    Is there a way to make a flex container? I have a 3 column row and I want the content to be the same height. I want the shorter content to stretch and fill the container.

    Thank you.

    #1244492

    Hey svreatt,

    It would have to be done via css. Please see the following:

    Whil the link is dealing with 6 columns. The code can be reverse engineered to work within 3 columns.

    Best regards,
    Jordan Shannon

    #1244510

    Thanks, that’s a bit tough for me to figure out.

    What i want it the photo in the left column to be at the bottom of the column.

    Thanks

    #1245030

    I updated the css to this.
    For some reason when I add Add a color section with custom ID “av-extra-columns”.
    The section doesn’t seem to read the css.

    /*—————————————-
    // Create Flex Columns
    //————————————–*/

    #av-extra-columns .entry-content-wrapper {
    display:flex;
    height:100vh;
    flex-wrap:wrap;
    align-content:stretch;
    }
    #av-extra-columns .column-top-margin {
    margin-top: 0 !important;
    }
    #av-extra-columns .flex_column {
    width: 33%;
    flex-basis: 33%;
    margin-left: 2%;
    margin-top: 20px!important;
    }
    #av-extra-columns .flex_column.first {
    clear: none!important;
    margin-left: 2%;
    }

    #1245537

    Hi svreatt,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1245884

    Here are a couple of screen shots to help better explain what I want to achieve.

    The first screen shot shows all of the content in the 3 rows is the same height, it fills the column.

    The second screen shows how the content is normally displayed with each column having different heights.

    I would like to use flex columns to achieve this.

    Thanks

    https://prorecoveryrx.com/wp-content/uploads/2020/09/Screen-Shot-2020-09-14-at-5.50.15-PM.png

    https://prorecoveryrx.com/wp-content/uploads/2020/09/Screen-Shot-2020-09-14-at-5.50.24-PM.png

    #1246536

    Hi,
    Sorry for the late reply and thanks for the screenshots and link to your page, I don’t believe that the custom css above is going to be the solution, as I understand your question, which is to have all 3 columns display the same height for each inner element, this is the goal, correct?
    So the equal height flex columns addresses the outer height, but your issue is the inner height.
    In each column you have an image, text, HR, price, and a button. Of all of these, the text element is the one element that will have a different height for each column, so if you add a custom class to the text element in each column the same height can be applied to each with css or js.
    Please give this a try. Do you have a test page that looks more like your screenshots?

    Best regards,
    Mike

    #1246548

    Thank you. I’m glad to try it out.

    Which code should I be using?

    Thanks

    #1246797

    Hi,
    If you add a custom class to the text element in the middle of the second & third columns, such as “custom-class” you could use this css:

    .custom-class {
    min-height:220px;
    }

    Without the custom class the css would look like this for your test page second & third columns:

    #top.page-id-742 #main > div > div > main > div > div > div.flex_column_table > div > section:nth-child(3),
    #top.page-id-742 #main > div > div > main > div > div > div.flex_column_table > div > section:nth-child(3) {
    	min-height:220px;
    }
    

    I noticed that in your second column, the HR, above the price, has a 30px top margin, so you will want to remove this to match the third column.

    Best regards,
    Mike

    #1248494

    Thank you very much.

    Is there a way to use the flex volume so I don’t have to guess at which height will work for each content box?

    #1248721

    Hi,
    Not in this situation. I checked your other pages in your “Supplements” menu to see if there is a way to have each of these columns have the same height for the text block element across these pages and it can be achieved with the following script. Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_equal_height_row_script(){
      ?>
      <script>
    (function($){
      $(window).load(function(){
        (function() {
    
          var currentTallest = 0,
              currentRowStart = 0,
              rowDivs = new Array();
    
          function setConformingHeight(el, newHeight) {
            el.data("originalHeight", (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight")));
            el.height(newHeight);
          }
    
          function getOriginalHeight(el) {
            return (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight"));
          }
    
          function columnConform() {
          	$('.hr-custom.hr-center.hr-icon-no.el_after_av_textblock').css({'margin-top':'0'});
            $('.flex_column.av_one_third section:nth-of-type(2)').each(function() {
    
              var $el = $(this);
    
              var topPosition = $el.position().top;
    
              if (currentRowStart != topPosition) {
                for(currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) setConformingHeight(rowDivs[currentDiv], currentTallest);
    
                rowDivs.length = 0;
                currentRowStart = topPosition;
                currentTallest = getOriginalHeight($el);
                rowDivs.push($el);
    
              } else {
    
                rowDivs.push($el);
                currentTallest = (currentTallest < getOriginalHeight($el)) ? (getOriginalHeight($el)) : (currentTallest);
    
              }
              
    
            });
    
            for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
              setConformingHeight(rowDivs[currentDiv], currentTallest);
            }
    
          }
    
          $(function() {
            columnConform();
          });
    
        })();
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_equal_height_row_script');  

    While this works for your six pages I would recommend adding custom classes to each of the columns so there won’t be any conflicts with other columns.

    Best regards,
    Mike

    #1249127

    Thank you. I see what you mean, it makes all the columns on the page the same size, even the second row ends up the same length as the first row.

    I’ll try adding the class as you suggested.

    Thanks again.

    #1249129

    I forget to ask what that custom class would look like.

    #1249633

    Hi,
    Sorry for the late reply, if you use the custom class cehrs then you would change the line above:
    $('.flex_column.av_one_third section:nth-of-type(2)').each(function() {
    to
    $('.cehrs section:nth-of-type(2)').each(function() {
    After applying the changes, please clear your browser cache and check.

    Best regards,
    Mike

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.