jquery - 列表项绝对底部与 JQuery 等列高

标签 jquery css height

我有两件事。

  1. 我的最后一个列表项绝对位于无序列表的底部,但它与无序列表的底部重叠。
  2. 我想将绝对底部与“JQuery 等列高度”一起使用,这样我的两列就彼此相等,因为我计划使用斜 Angular 边框。

我正在寻找有人来帮我解决这个问题,因为我现在陷入困境。

这是我的 jsfiddle,最后一个列表项绝对位于底部: http://jsfiddle.net/evanmoore/QPQ8Z/

这是 jquery 与最后一个列表项绝对底部相等的列高 http://jsfiddle.net/evanmoore/mCang/2/

var maxHeight = 0;
function setHeight(column) {
    //Get all the element with class = col
    column = $(column);
    //Loop all the column
    column.each(function() {       
        //Store the highest value
        if($(this).height() > maxHeight) {
            maxHeight = $(this).height()+2;
        }
    });
    //Set the height
    column.height(maxHeight);
}

$(document).ready(function() {
    setHeight('.wrapper');
});

最佳答案

最初将#disclosure li.notesposition设置为relative。这将使较高的列被推低,因此您可以获取 maxHeight。然后,在获得该数字后,将其设置回绝对值,这样它就可以是 bottom: 0

http://jsfiddle.net/mCang/3/

关于jquery - 列表项绝对底部与 JQuery 等列高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11540622/

相关文章:

javascript - JS try/catch 生成 jshint 错误

css - 只要 body 和 sub sub div 滚动就缩放 div

html - 表列最大宽度,省略号,nowrap : not working in IE 9

html - 我怎样才能得到高度 : 100% to account for existing pixel-heighted elements within the same div?

安卓 WebView : how to let the css use the entire height w/position absolute?

javascript - 当我关闭模态时,所有 hidden.bs.close 都被触发

javascript - 从数组动态创建输入并使它们与函数一起使用

javascript - 存储和恢复事件处理程序

css - 如何水平对齐多个图像(连续)?

wpf - 将 WPF 控件设置为扩展以填充可用空间,仅此而已