This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Results Box Width & Margin

#21507
Ernest MarcinkoErnest Marcinko
Keymaster

Thank you very much for the details, I may have found a solution.

I think this is something to do with the animations stacking, or something very unusual, I am not able to see anything strange, the width simply blows to infinity for no apparent reason.

The only possible solution I think, is to adjust it via a script, during window resize events. I have constructed a custom script for that. Please add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case! Also, make sure to clear all layers of cache (page, CDN, browser etc..) to make sure it’s present on the page output.

add_action('wp_footer', 'asp_custom_scrpt');
function asp_custom_scrpt() {
 ?>
 <script>
 jQuery(function($) {
  $(window).on('resize', function(){
    var t;
    clearTimeout(t);
    t = setTimeout(function(){
      $('.asp_r').each(function(i,o){
        var $this = $(this);
        $this.css('maxWidth', $('.asp_m_' + $this.data('id')).outerWidth());
        if ( $this.closest('.asp_shortcodes_container').length > 0 ) {
          $this.closest('.asp_shortcodes_container')
            .css('maxWidth', $('.asp_m_' + $this.data('id')).outerWidth());
        }
      });
    }, 300);
  });
  $(window).trigger('resize');  
 });
 </script>
 <?php
}

This should resolve the problem.