$(function () {
var isPortrait = window.matchMedia("(max-aspect-ratio: 1/1)").matches;
var isPadPortrait = (isPortrait && window.innerWidth <= 1200 && window.innerWidth >= 640) || false;
var isPhonePortrait = (isPortrait && window.innerWidth <= 639) || false;
var isMobPortrait = (isPadPortrait || isPhonePortrait) || false;
if (!isMobPortrait) {
var scene = new ScrollMagic.Scene({
triggerHook: 0,
triggerElement: '#trigger',
duration: '100%',
offset: 0
})
var mySwiper = new Swiper('.swiper-container', {
direction: 'vertical',
pagination: {
el: '.yfshw_nav',
type: 'bullets',
clickable: true,
bulletClass: 'yfshw_nav_item',
bulletActiveClass: 'active',
currentClass: 'active',
renderBullet: function (index, className) {
switch (index) {
case 0: text = ''; break;
case 1: text = ''; break;
case 2: text = ''; break;
case 3: text = ''; break;
case 4: text = ''; break;
}
return '
' + text + '
';
},
},
on: {
progress: function (swiper, progress) {
scene.progress(progress);
},
},
})
var controller = new ScrollMagic.Controller();
scene
.setPin('.yfshw_container')
.on("progress", function (event) {
if (event.progress > 0 && event.progress < 0.2) {
mySwiper.slideTo(0)
} else if (event.progress > 0.2 && event.progress < 0.4) {
mySwiper.slideTo(1)
} else if (event.progress > 0.4 && event.progress < 0.6) {
mySwiper.slideTo(2)
} else if (event.progress > 0.5 && event.progress < 0.8) {
mySwiper.slideTo(3)
} else if (event.progress > 0.8) {
mySwiper.slideTo(4)
}
})
.addTo(controller)
}
})
{"enabled":true,"consentTitle":"We value your privacy","message":"This content is hosted by an external provider. Enabling it may allow the provider to process your personal data and set cookies.\r\n","acceptLabel":"Allow \u0026 Continue","alwaysAcceptLabel":"Always trust and apply default supplier settings.","consentState":"undecided"}