开发者

How to make Joomla main content and modules columns match height dynamically?

开发者 https://www.devze.com 2023-01-07 08:22 出处:网络
Hi I have a Joomla site with a template that has 2 columns. One for the main content and the other for modules. On different pages either the content column is shorter than the module column or vice v

Hi I have a Joomla site with a template that has 2 columns. One for the main content and the other for modules. On different pages either the content column is shorter than the module column or vice versa. How can I ensure that the 2 columns are always of the same height so that they both meet up equally at the footer 开发者_如何学Goon any page?


Using Javascript:

window.addEvent('load', function(){  
// Load assuming there could be images.    
// Otherwise use domready  
  var columns = $$('css selector for the columns');  
  if(columns && columns.length > 1){  
     var heights = [];  
     columns.each(function(el){  
        heights.push(this.getStyle('height'));  
     }).setStyle('height', Math.max.apply( Math, heights ));  
     delete(heights);  
  }  
});  

You can use CSS to make sure your footer stays at the bottom of the page. Love Mootools.


You'll need some CSS hacks or Javascript. Personally I favour the Javascript method, google equal height collumns.

0

精彩评论

暂无评论...
验证码 换一张
取 消