0

こんにちは、次の HTML があります。

    <article id="jobwall">
    <ul>
        <li class="box">Hello World</li>
        <li class="box">Hello World</li>
        <li class="box">Hello World</li>
        <li class="box noRMar">Hello World</li>
        <li class="box">Hello World</li>
        <li class="box">Hello World</li>
        <li class="box">Hello World</li>
    </ul>
</article>

そして、次のCSS、

#jobwall { 
        width:100%;
        float:left;
        clear:both;
        overflow:hidden;
        margin:15px 0px 0px 0px;
    }   

    #jobwall li {
        width:221px;
        float:left;
        margin:0px 17px 20px 0px;
        border:1px solid red;

    }

        #jobwall li.noRMar {
            margin:0px 0px 20px 0px;
        }

Masonary と呼ばれる jquery のプラグインを実装しようとしています。アイデアは、4 つの li を並べてフロートできるようにすることですが、masonary を追加すると 3 つしかフロートできません。

$('#jobwall').masonry({

          singleMode: false,
          // Disables measuring the width of each floated element.
          // Set to true if floated elements have the same width.
          // default: false

          columnWidth: 241,
          // Width in pixels of 1 column of your grid.
          // default: outer width of the first floated element.

          itemSelector: '.box:visible',
          // Additional selector to specify which elements inside
          // the wrapping element will be rearranged.
          // Required for Infinite Scroll with window resizing.

          resizeable: true,
          // Binds a Masonry call to window resizes 
          // so layout appears fluid.
          // default: true

          animate: true,
          // Animates layout rearrangements.
          // default: false

          saveOptions: true
          // Masonry will use the options from previous Masonry
          // calls by default, so you only have to enter in options once
          // default: true

        });

基本的に、私はメーソナリーをリとして実装し、最終的にはスライドダウンするコンテンツをさらに表示します。リがその順序でフローティングし続ける必要があります。これを実装するためのより良い方法はありますか、それともメイソンリーで4つのliを連続させることができますか

4

1 に答える 1

1

4 * 221px (+ マージン) は、ページの幅 100% より大きいですか?

于 2011-04-11T12:13:31.780 に答える