我怎样才能将fullpage.js的部分分为2部分(div),并且只使用** Fullpage.js **启用**滚动**只在右边(div)?

时间:2016-08-10 18:16:53

标签: html css fullpage.js

这是HTML,网页Div正在运作!我需要在第二个div上添加更多内容,并在我这样做时启用滚动。

<section class="vertical-scrolling" id="section">
<div id="abt">
      <div id="about" >
          <h3>about</h3>
      </div>
      <div id="abouttxt">
         content with scrolling
      </div>
</div>
</section>

这是CSS:

#about {
height: relative;
    float: left;
}
#abouttxt {
    float: right;
    width: 50%;
    text-align: left;
    text-align: justify;
    text-justify: inter-word;
} 

2 个答案:

答案 0 :(得分:0)

HTML:

<div id="content">
<div id="left"></div>
<div id="right"></div>
</div>

CSS:

#content, html, body {
height: 98%;
}

#left {
    float: left;
    width: 50%;
    background: red;
    height: 100%;
    overflow: scroll;
}

#right {
    float: left;
    width: 50%;
    background: blue;
    height: 100%;
    overflow: scroll;
}

答案 1 :(得分:0)

HTML:

 <div class="section">
        <div class="leftSide">
            <div class="box">Whatever</div>
        </div>
        <div class="rightSide">
            <div class="box">Whatever</div>
            <div class="box">Whatever</div>
            <div class="box">Whatever</div>
        </div>
</div>

CSS:

.leftSide{
    float: left;
    width: 50%;
    background: blue;
    height: 100%;
}
.rightSide{
    float: left;
    width: 50%;
    background: red;
    height: 100%;
    overflow: scroll;
}

然后你必须使用fullpage.js的选项normalScrollElements

$('#fullpage').fullpage({
    sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
    normalScrollElements: '.rightSide'
});

Demo online