0

第一次在这里发帖,我会尽量让自己超级清楚。我在 rails 应用程序上使用 FullpageJS 库(https://github.com/alvarotrigo/fullPage.js/),但我不知道如何在(同一页面的)部分之间导航。我在互联网上查找了一些教程和主题,但是当我尝试这些解决方案时,同样的问题,我的网站实际上冻结了。

我正在使用 vanilla JS 来使库正常工作,直到现在一切正常。

我应该准确地说,当我输入像 www.mysite.com/#contact 这样的网址时,动画效果很好。当我单击链接时会出现问题。

非常感谢 :)

这是我的代码:

 new fullpage("#fullpage", {
    //options here
    licenseKey: ...,
    autoScrolling: true,
    navigation: true,
    keyboardScrolling: true,
	  animateAnchor: true,
    anchors: ['home', 'about', 'project', 'cv', 'contact']
    )};
<div class="fullpage" id="fullpage">  
       <section class="section s1" data-anchor="home">
            <h1>blabla</h1>
            <a href="#about" class="menu-item"></a>
            <a href="#project" class="menu-item"></a>
            <a href="#cv" class="menu-item"></a>
            <a href="#contact" class="menu-item"></a>
        </section>
        <section class="section s2" data-anchor="about">
            <h1>À propos</h1>
        </section>
        <section class="section s3" data-anchor="projet">
         
            <h1>Projet</h1>
            
        </section>
        <section class="section s4" data-anchor="cv">
           
            <h1>CV</h1>
           
        </section>
        <section class="section s5" data-anchor="contact">
            <h1>Contact</h1>
        </section>
      </div>

强文本

4

0 回答 0