Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用css或jquery、javascript平均增加所有框的高度_Javascript_Jquery_Html_Css - Fatal编程技术网

使用css或jquery、javascript平均增加所有框的高度

使用css或jquery、javascript平均增加所有框的高度,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我有下面的html结构,它不会改变 <article class="col-md-3 col-sm-3 diagnostic-block worth"> <blockquote> <header> <h6> <a onclick="javascript:doOpenURL('xyz.aspx?Section=11','contentArea','1020','70

我有下面的html结构,它不会改变

<article class="col-md-3 col-sm-3 diagnostic-block worth">
    <blockquote>
        <header>
            <h6>
                <a onclick="javascript:doOpenURL('xyz.aspx?Section=11','contentArea','1020','700','1');" href="javascript:void(null)">Page heading will goes</a>
            </h6>
        </header>
        <footer>
            <small>Text hereText hereText hereText hereText hereText here</small>
            <p>Worth a look</p>
        </footer>
    </blockquote>
</article>

文本在此文本在此文本在此文本在此文本在此文本
值得一看

这应该可以实现您想要的

$.fn.eqHeights = function(options) {

var defaults = {  
    child: false ,
  parentSelector:null
};  
var options = $.extend(defaults, options); 

var el = $(this);
if (el.length > 0 && !el.data('eqHeights')) {
    $(window).bind('resize.eqHeights', function() {
        el.eqHeights();
    });
    el.data('eqHeights', true);
}

if( options.child && options.child.length > 0 ){
    var elmtns = $(options.child, this);
} else {
    var elmtns = $(this).children();
}

var prevTop = 0;
var max_height = 0;
var elements = [];
var parentEl;
elmtns.height('auto').each(function() {

  if(options.parentSelector && parentEl !== $(this).parents(options.parentSelector).get(0)){
    $(elements).height(max_height);
    max_height = 0;
    prevTop = 0;
    elements=[];
    parentEl = $(this).parents(options.parentSelector).get(0);
  }

    var thisTop = this.offsetTop;

    if (prevTop > 0 && prevTop != thisTop) {
        $(elements).height(max_height);
        max_height = $(this).height();
        elements = [];
    }
    max_height = Math.max(max_height, $(this).height());

    prevTop = this.offsetTop;
    elements.push(this);
});

$(elements).height(max_height);
};

如果它们都有相同的高度,并且没有任何响应问题,那么您可以使用css的min height属性:)

是否可以将您的css添加到问题中。如果容器不改变,为什么不为容器设置一个固定的高度?可能重复