<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.9.7/jquery.fullpage.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.9.7/jquery.fullpage.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.9.7/vendors/jquery.easings.min.js"></script>
<script>
function check_direction(index, direction) {
var length = $($(".section").get(index-1)).find(".fp-slide").length;
var active = -1;
if (length) {
$($(".section").get(index-1)).find(".fp-slide").each(function(i, item) {
if ($(item).hasClass("active")) {
active = i + 1;
}
})
if (direction == "down" && active < length) {
$.fn.fullpage.moveSlideRight();
return false;
}
if (direction == "up" && active > 1) {
$.fn.fullpage.moveSlideLeft();
return false;
}
}
}
$(document).ready(function() {
// Указываем простые секции
var sections = $("#rec101339021, #rec101339044, #rec101339058");
// Указываем группы слайдов
var sliders = ["#rec101339047, #rec101339052, #rec101339055", "#rec101339059, #rec101339162"];
sections.wrap("<div class='section'></div>");
sliders.forEach(function(s){
let parents = $(s).wrap("<div class='slide'></div>");
parents.parent().wrapAll("<div class='section'></div>");
})
setTimeout(function(){
if ($("div").last().parent().parent().parent().attr("id").length == 9) {
$("div").last().parent().parent().parent().wrap("<div class='section fp-section'></div>").parent().appendTo("#fullpage").addClass("section")
}
}, 3000)
$('#allrecords').fullpage({
// Скорость скролла
scrollingSpeed: 600,
// Плавность скролла
// https://easings.net/ru
easing: "easeInOutCubic",
// Стрекли управления на горизонтальном скролле
controlArrows: false,
// Управление клавиатурой
keyboardScrolling: true,
// Не трогать
scrollHorizontally: true,
loopHorizontal: false,
loopBottom: true,
css3: true,
scrollBar: true,
onLeave: function(index, nextIndex, direction) {
var allow = true;
if (direction == "down" && nextIndex == 1) {
allow = false;
}
if (check_direction(index, direction) == false) {
return false;
}
return allow;
},
});
});
</script>
<style>
body {
overflow: hidden !important;
}
</style>