如何在fullpage.js上的nav菜单上添加horizantal行

时间:2016-09-29 09:57:10

标签: jquery html css fullpage.js

如何在导航菜单的顶部添加水平线,线应该像一个进度条,它将从导航1&根据当前部分浏览最后一个导航。

http://codepen.io/anon/pen/LRjpmb

<header>
  <div class="header-top clearfix">
    <h1 class="l-left"><a href="#firstSection">Your Logo</a></h1>
    <a class="l-right toggle-menu" href="#">
      <i></i>
      <i></i>
      <i></i>
    </a>
  </div>

  <nav class="hide">
    <ul id="menu">
      <li data-menuanchor="firstSection">
        <a href="#firstSection" title="First Section">First Section</a>
      </li>
      <li data-menuanchor="secondSection">
        <a href="#secondSection" title="Second Section">Second Section</a>
      </li>
      <li data-menuanchor="thirdSection">
        <a href="#thirdSection" title="Second Section">Third Section</a>
      </li>
      <li data-menuanchor="fourthSection">
        <a href="#fourthSection" title="Fourth Section">Fourth Section</a>
      </li>
      <li data-menuanchor="fifthSection">
        <a href="#fifthSection" title="First Slide">First Slide</a>
      </li>
      <li data-menuanchor="fifthSection/1">
        <a href="#fifthSection/1" title="Second Slide">Second Slide</a>
      </li>
    </ul>
  </nav>
</header>

<div id="fullpage">
  <section class="vertical-scrolling">
    <h2>fullPage.js</h2>
    <h3>This is the first section</h3>
    <div class="scroll-icon">
      <p>Jump into the last slide</p>
      <a href="#fifthSection/1" class="icon-up-open-big"></a>
    </div>
  </section>
  <section class="vertical-scrolling">
    <h2>fullPage.js</h2>
    <h3>This is the second section</h3>
  </section>
  <section class="vertical-scrolling">
    <h2>fullPage.js</h2>
    <h3>This is the third section</h3>
  </section>
  <section class="vertical-scrolling">
    <h2>fullPage.js</h2> 
    <h3>This is the fourth section</h3>
  </section>
  <section class="vertical-scrolling">
    <div class="horizontal-scrolling">
      <h2>fullPage.js</h2>
      <h3>This is the fifth section and it contains the first slide (actually section == first slide)</h3>
    </div>
    <div class="horizontal-scrolling">
      <h2>fullPage.js</h2>
      <h3>This is the second slide</h3> 
      <p class="end">Thank you!</p>
    </div>
  </section>
</div>

** UPDATE *

在此示例https://codepen.io/genievn/pen/Bwlnj

中尝试执行相同的操作

1 个答案:

答案 0 :(得分:1)

{{1}}

根据视口上显示的部分

调整导航的宽度