html - Bootstrap 如何修复动态列表数据

标签 html css twitter-bootstrap

我已经在我的页面中显示了列表项,但我无法显示它们。当我在每个元素中有不同的内容时,它不会匹配。我应该怎么办? 我想移动左侧的最后一项并获得空间。

这是我的代码:

.single-profile-top, .single-profile-bottom {
  border: 1px solid #ddd;
  padding: 15px;
  position: relative;
  margin-bottom: 40px;
}

最佳答案

Jquery 可用于使所有列表数据具有相同的高度。

引用答案link

function setEqualHeight(selector, triggerContinusly) {
    var elements = $(selector)
    elements.css("height", "auto")
    var max = Number.NEGATIVE_INFINITY;

    $.each(elements, function(index, item) {
        if ($(item).height() > max) {
            max = $(item).height()
        }
    })

    $(selector).css("height", max + "px")

    if (!!triggerContinusly) {
        $(document).on("input", selector, function() {
            setEqualHeight(selector, false)
        })

       $(window).resize(function() {
            setEqualHeight(selector, false)
       })
    }


}
setEqualHeight(".sameh", true) 

关于html - Bootstrap 如何修复动态列表数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30021875/

相关文章:

html - 文本超出容器的问题( Bootstrap )

css - 如何在 Twitter Bootstrap 中制作自定义宽度的居中容器?

html - 单击更改背景图像

javascript - Chrome 自动完成锁定输入,就像它们不可点击一样

javascript - 管理网站后台和前台

php - 从 Web 开发学习 Objective C (Cocoa) 进行 iPhone 编程?

html - 嵌入式 Bootstrap div 在非 Bootstrap 站点中没有响应

html - 避免 html 元素在窗口狭窄时错位

css - 为什么 IE 显示灰色框在内容下方,而不是上方?

HTML5 模态对话框在页面加载时很快显示,我该如何停止?