0

我在将 Accordion 放入 Tab 时遇到问题。

<div class="section-container tabs" data-section="tabs">
    <section>
        <p class="title" data-section-title><a href="#">Tab1</a></p>
        <div class="content" data-section-content>
        <div class="section-container accordion" data-section="accordion">
             <section>
                  <p class="title" data-section-title><a href="#">Year 1</a></p>
                  <div class="content" data-section-content>
                       <p>Content of section 1.</p>
                  </div>
             </section>
             <section>
                   <p class="title" data-section-title><a href="#">Year 2</a></p>
                    <div class="content" data-section-content>
                          <p>Content of section 2.</p>
                    </div>
             </section>
        </div>
      </div>             
    </section>
</div><!-- tabs -->

他们出现,但点击手风琴没有打开。有什么办法可以做到吗?

4

2 回答 2

0

No need data-slug anywhere. Solved rewrite CSS with

.accordion > section.active > .content { display: block; position: relative;}

于 2013-06-11T20:51:38.557 回答
0

您缺少数据块,以便它知道打开了什么:

<div class="section-container auto" data-section>
  <section>
    <p class="title"><a href="#section1">ROOT: Section 1</a></p>
    <div class="content" data-slug="section1">
      <p>Content 1 Summary Paragraphs</p>



      <div class="section-container auto accordion" data-section="accordion">
        <section>
          <p class="title"><a href="#section1-1">DETAIL: #1</a></p>
          <div class="content" data-slug="section1-2">
            <p>Detail awesome stuff!</p>
          </div>
        </section>
        <section>
          <p class="title"><a href="#section1-2">DETAIL: #2</a></p>
          <div class="content" data-slug="section1-2">
            <p>Detail awesome stuff numeroe duo.</p>
          </div>
        </section>
      </div>
    </div>
  </section>
  <section>
    <p class="title"><a href="#section2">ROOT: Section 2</a></p>
    <div class="content" data-slug="section2">
      <p>Content 2</p>
    </div>
  </section>
</div>
于 2013-06-11T08:00:12.757 回答