当我单击“向下滚动”按钮并移至当前部分的ID时,我试图禁用其他部分。 我正在使用fullpage.js进行部分滚动,并且尝试使用jQuery和CSS,但我认为这不是一个好的解决方案
<div id="fullpage">
<div class="section active" id="section0">
<a href="#section1">Scroll Down</div>
</div>
<div class="section" id="section1">
<a href="#section3">Scroll Down</div>
</div>
<div class="section" id="section3">
<a href="#section5">Scroll Down</div>
</div>
<div class="section" id="section5">
<a href="#section0">Scroll Down</div>
</div>
</div>
jQuery代码:
$('#scroll-1').on('click', function () {
$('#section1').css('display', 'block');
$('#section3').css('display', 'none');
$('#section5').css('display', 'none');
$('#section0').css('visibility', 'hidden');
});
整页:
$(document).ready(function() {
$('#fullpage').fullpage({
sectionsColor: ["#fff", "#fff", "#fff", "#fff", "#fff"],
anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
// menu: '#menu'
css3: true,
scrollingSpeed: 300,
navigation: true,
});
});