使用isotope.js,更深层次的影响正在受到影响

时间:2014-09-18 19:44:24

标签: javascript jquery jquery-isotope megamenu

我使用isotope.js制作megamenu,并且有序地在megamenu堆栈中拥有UL。基本上我有以下HTML:

<ul>
  <li>ABOUT
    <ul>
      <li>We're Great</li>
      <li>We're Really Great</li>
    </ul>
  </li>
  <li>DIVISIONS
    <ul class="level-2">
      <li>Category One
        <ul class="level-3">
          <li>Item One</li>
          <li>Item Two</li>
        </ul>
      </li>
    </ul>
    <ul class="level-2">
      <li>Category Two
        <ul class="level-3">
          <li>Item One</li>
          <li>Item Two</li>
          <li>Item Three</li>
          <li>Item Four</li>
        </ul>
      </li>
    </ul>
    <ul >
      <li>Category Three
        <ul class="level-3">
          <li>Item One</li>
          <li>Item Two</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Products
    <ul>
      <li>Product One</li>
      <li>Product Two</li>
    </ul>
  </li>
</ul>

我需要的是,UL中的LI与类&#34; level-2&#34;,在megamenu中很好地堆叠在一起,并将isotope.js应用于它们。< / p>

很简单,除了同位素似乎对我来说,就是当我使用以下JS时:

var $container = $('ul.level-2');

$container.isotope({
    itemSelector: 'li'
});

它甚至在UL的3级中也适用于同类产品......我只希望将其应用于UL的这一层,因此它们堆叠友好,但我不会#39不希望更深层次的LI发生任何事情,他们应该在各自的UL范围内保持正常。

我有位置:相对于包含的UL,并且LI左侧浮动,显示:块也在它们上面。不确定我可能会缺少什么!!

希望这实际上是有道理的。有人能指出我正确的方向吗?

0 个答案:

没有答案
相关问题