2016-06-08 46 views
0

對於我們用Magento結賬,我使用的是h-o.nl中的Improved OPC design(css only)如何計算變高

每個.opc-step- *都具有postion:絕對值,但#checkoutSteps具有靜態最小高度。因此,每一步都有另一個高度。.opc-step- *

當客戶有很多產品要檢出時,div的最小高度將被超出。

所以我需要在#checkoutSteps的最小高度處設置.opc-step- *的div高度。這很好。但它需要更高的80像素。如何計算divHeight + 80px?

這是不計算功能我有opcheckout.js

gotoSection: function (section, reloadProgressBlock) { 

     if (reloadProgressBlock) { 
      this.reloadProgressBlock(this.currentStep); 
     } 
     this.currentStep = section; 
     var sectionElement = $('opc-' + section); 
     sectionElement.addClassName('allow'); 
     this.accordion.openSection('opc-' + section); 
     if(!reloadProgressBlock) { 
      this.resetPreviousSteps(); 
     } 
     jQuery("html, body").delay(10).animate({ 
      scrollTop: (
       jQuery("#opc-"+section).offset().top - jQuery('#header').height() 
      ) 
     }, 
     50); 
     var divHeight = jQuery("#checkout-step-"+ section).outerHeight(true); 
     jQuery('#checkoutSteps').css('min-height', divHeight+'px'); 
    }, 

回答

1

我固定它

jQuery('#checkoutSteps').css('min-height', divHeight+'px'); 

變化成:

jQuery('#checkoutSteps').css({'min-height':(divHeight+80)+'px'});