Answer the question
In order to leave comments, you need to log in
Problem with fullpage.js?
i have this code
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)
})
},
})
})
if (0 == state) {
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question