【问题标题】:jQuery Masonry - I want the div to scroll, not the pagejQuery Masonry - 我希望 div 滚动,而不是页面
【发布时间】:2013-02-17 05:22:54
【问题描述】:

让我描述一下我想要实现的目标。在浏览器的左侧,我有用于过滤数据的所有类型的复选框和单选按钮。在右侧,我使用 jQuery Masonry 显示该数据。现在,当数据集很大时,您必须在页面上向下滚动。我想在 div 上指定一个高度并向下滚动,以便用户可以随时查看他们的过滤器选择。有人用 Masonry 做过这个吗?我已经在几个不同的场合“用谷歌搜索”过,但似乎找不到这样做的人。

【问题讨论】:

    标签: javascript jquery jquery-plugins jquery-masonry


    【解决方案1】:

    我无法解释为什么它会起作用,只能说它纯粹是为了我自己的目的而起作用。

    <style type="text/css">
    #results {overflow: auto;}
    </style>
    <script type="text/javascript">
        $(function () {           
            $("#results").masonry({
                itemSelector : '.item',
                isFitWidth: true,
                isAnimated: true
              }).css("height", "450px");
    </script>
    

    除了 Chrome 之外,我还没有在其他任何地方看过这个,但我会在推出之前对其进行更彻底的测试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多