jQuery Equal Height Columns

痞子三分冷 提交于 2019-12-13 02:18:31

问题


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()));


回答1:


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);



回答2:


Firebug show this error :

preloadImages is not defined
 preloadImages([ 


来源:https://stackoverflow.com/questions/7053688/jquery-equal-height-columns

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!