jQuery столбцы равной высоты - PullRequest
1 голос
/ 14 августа 2011

http://shoes4school.project -x.me / получить-involved.html

Может кто-нибудь, пожалуйста, скажите мне, что я делаю неправильно, в faux столбца jQuery ... Я не могу заставить его работать после попытки нескольких различных методов ...

код, который я использую ... мой URL выше

$ j (". Content-block"). Height (Math.max ($ ("# right"). Height (), $ (". Content-block"). Height ()));

Ответы [ 2 ]

2 голосов
/ 03 августа 2012

Как подделать столбцы на веб-странице

(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);
0 голосов
/ 14 августа 2011

Firebug показать эту ошибку:

preloadImages is not defined
 preloadImages([ 
...