簡體   English   中英

react-fullpage.js - 如何在某個部分加載網站,而不是第一部分?

[英]react-fullpage.js - How to load website on a certain section, as opposed to the first section?

問題:我希望網站加載到第 3 部分,而不是第 1 部分。 然后用戶將向上滾動到內容,而不是向下滾動。 我基本上想顛倒網站的傳統順序。

<div className="section">
<h3>Section 3</h3>
</div>

蓋茨比(反應),@fullpage/react-fullpage

https://codesandbox.io/s/m34yq5q0qx

您可以使用active類設置初始部分: https : //codesandbox.io/s/react-fullpagejs-example-b618h


  <div className="section active">
    <h3>Section 3</h3>
    <button onClick={() => fullpageApi.moveTo(1, 0)}>
      Move top
    </button>
  </div>

https://github.com/alvarotrigo/react-fullpage/issues/168

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM