jQuery Equal Height Columns

2019-07-29 12:20发布

http://shoes4school.project-x.me/get-involved.html

Can someone please tell me what i'm doing wrong the the jQuery column faux... I can not get it to work after trying several different methods...

The code i'm using is... my url is above

$j(".content-block").height(Math.max($("#right").height(), $(".content-block").height()));

标签: height equals
2条回答
甜甜的少女心
2楼-- · 2019-07-29 13:11

Firebug show this error :

preloadImages is not defined
 preloadImages([ 
查看更多
我命由我不由天
3楼-- · 2019-07-29 13:13

How to faux columns on webpage

(function($){
// add a new method to JQuery

$.fn.equalHeight = function() {
   // find the tallest height in the collection
   // that was passed in (.column)
    tallest = 0;
    this.each(function(){
        thisHeight = $(this).height();
        if( thisHeight > tallest)
            tallest = thisHeight;
    });

    // set each items height to use the tallest value found
    this.each(function(){
        $(this).height(tallest);
    });
}
})(jQuery);
查看更多
登录 后发表回答