у меня есть вот такой код
jQuery(document).ready(function ($) {
$("#fullpage").fullpage({
easingcss3: "cubic-bezier(0.645, 0.045, 0.355, 1)",
scrollingSpeed: 1e3,
anchors: ["Главная", "Обо мне"],
navigation: !0,
navigationPosition: "left",
animateAnchor: !1,
onLeave: function (index, nextIndex, direction) {
if (1 == index) anime({ targets: ".scrollDown", translateY: "180%", duration: 500, easing: "easeInOutCubic" })
if (1 == nextIndex) anime({ targets: ".scrollDown", translateY: ["180%", 0], duration: 500, easing: "easeInOutCubic" })
if (0 == state) {
var nextClass = ".fp-section-" + nextIndex
anime
.timeline()
.add({ targets: nextClass + " .image", scale: [0.85, 1], translateX: ["10%", 0], translateZ: 0, easing: "easeOutCubic", duration: 1500, delay: 500 })
.add({
targets: nextClass + " .image__cover",
translateX: [0, "110%"],
translateZ: 0,
easing: "easeInOutQuart",
duration: function (el, i) {
return 1200 - 200 * i
},
offset: "-=1700",
})
.add({ targets: nextClass + " .page-num p", translateY: ["100%", 0], translateZ: 0, easing: "easeInOutCubic", duration: 1e3, offset: "-=1200" })
.add({
targets: nextClass + " .js-letter",
translateX: ["-105%", 0],
translateZ: 0,
easing: "easeInOutCubic",
duration: 800,
delay: function (el, i) {
return 50 * i
},
offset: "-=1500",
})
if (1 == index)
anime({
targets: ".js-moon",
translateX: [0, "100%"],
translateZ: 0,
opacity: [1, 0],
easing: "easeOutCubic",
duration: 800,
delay: function (el, i) {
return 50 * i
},
})
if (1 == nextIndex)
anime({
targets: ".js-moon",
translateX: ["100%", 0],
translateZ: 0,
opacity: [0, 1],
easing: "easeOutCubic",
duration: 800,
delay: function (el, i) {
return 500 + 50 * i
},
})
}
},
afterLoad: function (anchorLink, index) {},
afterRender: function () {
$(".section").each(function (i) {
var num = i + 1
$(this).addClass("fp-section-" + num)
})
},
})
})
И в консоли выходит ошибка
Uncaught ReferenceError: state is not defined
at a.fn.init.onLeave (index.js:31)
at scrollPage (jquery.fullPage.js:1396)
at moveSectionDown (jquery.fullPage.js:394)
at scrolling (jquery.fullPage.js:1079)
at HTMLDocument.MouseWheelHandler (jquery.fullPage.js:1252)
index.js:31 - это вот эта строка
if (0 == state) {
я не понимаю в чем проблема...