简体   繁体   English

fullpage.js独立部分

[英]fullpage.js independent sections

I am using fullpage.js 我正在使用fullpage.js

I have created a structure like so 我已经创建了这样的结构

<section id="portfolio">
    <div class="col-lg-5 col-sm-5" id="portfolio-left">
        &nbsp;
    </div>

    <div class="col-lg-7 col-sm-7" id="portfolio-right">
        <div id="fullpage">
            <section class="vertical-scrolling">
                <div class="horizontal-scrolling">
                    <img src="https://www.scienceabc.com/wp-content/uploads/2016/05/horse-running.jpg">
                </div>
                <div class="horizontal-scrolling">
                    <img src="https://i.ytimg.com/vi/a6gHj0bHmg8/maxresdefault.jpg">
                </div>
            </section>
            <section class="vertical-scrolling">
                <h2>fullPage.js</h2>
                <h3>This is the second section</h3>
            </section>
        </div>
    </div>
</section>

And then added the following Javascript as per the docs 然后根据文档添加以下Javascript

$('#fullpage').fullpage({
    sectionSelector: '.vertical-scrolling',
    slideSelector: '.horizontal-scrolling',
    navigation: true,
    slidesNavigation: true,
    css3: true,
    controlArrows: false,
});

I have set up a JSFiddle to demonstrate where I am at with things. 我已经建立了一个JSFiddle来展示我在做什么。 So at the moment, you can scroll horizontally and vertically. 所以此刻,您可以水平和垂直滚动。 So my first image is a horse, and what I want to do is when you are on this section, if you scroll vertically for it to display information about the horse. 所以我的第一张图片是一匹马,我想要做的就是当你在这一部分时,如果你垂直滚动它以显示有关马的信息。 So essentially, I am trying to make the vertical scrolling relate to the section parent. 基本上,我试图让垂直滚动与父节相关。 If you are on the bear image and scroll vertically, it should display information about the bear. 如果您在熊图像上并垂直滚动,它应显示有关熊的信息。

Would something like this be possible? 这样的事情会成为可能吗?

Thanks 谢谢

Yeap. 叶氏。 Possible with the Interlocked Slides extension . 可以使用Interlocked Slides扩展

Unfortunately it is not easy to do it by yourself. 不幸的是,你自己做这件事并不容易。 There are some core restrictions when it comes to move multiple slides in different sections at the same time. 在同时移动不同部分的多个幻灯片时,存在一些核心限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM