PATH:
home
/
thebhoeo
/
.trash
/
woodmart
/
js
/
scripts
/
elements
woodmartThemeModule.$document.on('wdShopPageInit', function() { woodmartThemeModule.sliderAnimations(); woodmartThemeModule.sliderLazyLoad(); }); [ 'frontend/element_ready/wd_slider.default' ].forEach( function (value) { woodmartThemeModule.wdElementorAddAction(value, function() { woodmartThemeModule.sliderAnimations(); woodmartThemeModule.sliderLazyLoad(); }); }); woodmartThemeModule.sliderClearAnimations = function($activeSlide, firstLoad) { // WPB clear on first load first slide. if (firstLoad) { $activeSlide.querySelectorAll('[class*="wpb_animate"]').forEach( function (animateElement) { var classes = Array.from(animateElement.classList); var name; for (var index = 0; index < classes.length; index++) { if (classes[index].indexOf('wd-anim-name_') >= 0) { name = classes[index].split('_')[1]; } } if ( animateElement.classList.contains('wpb_start_animation') ) { animateElement.classList.remove('wpb_start_animation') } if ( animateElement.classList.contains('animated') ) { animateElement.classList.remove('animated') } if ( animateElement.classList.contains(name) ) { animateElement.classList.remove(name) } }); } // WPB clear all siblings slides. $activeSlide.parentNode.querySelectorAll('[class*="wpb_animate"]').forEach( function (animateElement) { var classes = Array.from(animateElement.classList); var delay = 0; var name; for (var index = 0; index < classes.length; index++) { if (classes[index].indexOf('wd-anim-delay_') >= 0) { delay = parseInt(classes[index].split('_')[1]); } if (classes[index].indexOf('wd-anim-name_') >= 0) { name = classes[index].split('_')[1]; } } setTimeout(function() { if ( animateElement.classList.contains('wpb_start_animation') ) { animateElement.classList.remove('wpb_start_animation') } if ( animateElement.classList.contains('animated') ) { animateElement.classList.remove('animated') } if ( animateElement.classList.contains(name) ) { animateElement.classList.remove(name) } }, delay); }); }; woodmartThemeModule.sliderAnimations = function() { document.querySelectorAll('.wd-slider > .wd-carousel-inner > .wd-carousel').forEach( function (sliderWrapper) { sliderWrapper.querySelectorAll('[class*="wd-animation"]').forEach( function (slide) { slide.classList.add('wd-animation-ready'); }); runAnimations(sliderWrapper.querySelector('.wd-slide'), true); sliderWrapper.addEventListener('wdSlideChange', function (e) { var slide = Array.prototype.filter.call( e.target.swiper.wrapperEl.children, (element) => e.detail.activeIndex == element.dataset.swiperSlideIndex, ).shift(); if (!slide) { slide = e.target.swiper.wrapperEl.children[e.detail.activeIndex]; } runAnimations(slide); woodmartThemeModule.$document.trigger('wood-images-loaded'); }); function runAnimations(slide, firstLoad = false) { woodmartThemeModule.sliderClearAnimations(slide, firstLoad); woodmartThemeModule.runAnimations(slide, firstLoad); } }); }; woodmartThemeModule.runAnimations = function($activeSlide, firstLoad) { // Elementor. $activeSlide.parentElement.querySelectorAll('[class*="wd-animation"]').forEach( function (animateElement) { animateElement.classList.remove('wd-animated'); animateElement.classList.remove('wd-in'); }); $activeSlide.querySelectorAll('[class*="wd-animation"]').forEach( function (animateElement) { var delay = 0; animateElement.classList.forEach((classname) => { if (classname.includes('wd_delay_')) { delay = parseInt(classname.split('_')[2]); } }) setTimeout(function() { animateElement.classList.add('wd-animated'); animateElement.classList.add('wd-in'); }, delay); }); // WPB. $activeSlide.querySelectorAll('[class*="wpb_animate"]').forEach( function (animateElement) { var classes = animateElement.classList; var delay = 0; var name; for (var index = 0; index < classes.length; index++) { if (classes[index].indexOf('wd-anim-delay_') >= 0) { delay = parseInt(classes[index].split('_')[1]); } if (classes[index].indexOf('wd-anim-name_') >= 0) { name = classes[index].split('_')[1]; } } setTimeout(function() { animateElement.classList.remove('wd-off-anim'); animateElement.classList.add('wpb_start_animation'); animateElement.classList.add('animated'); }, delay); }); }; woodmartThemeModule.sliderLazyLoad = function() { const slider = document.querySelectorAll('.wd-slider > .wd-carousel-inner > .wd-carousel'); window.addEventListener('wdEventStarted', function() { slider.forEach(function (carousel) { load(carousel.querySelector('.wd-carousel-wrap').firstElementChild); }); }); slider.forEach( function (carousel) { carousel.addEventListener('wdSlideChange', function (e) { var slide = Array.prototype.filter.call( e.target.swiper.wrapperEl.children, (element) => e.detail.activeIndex == element.dataset.swiperSlideIndex, ).shift(); if (!slide) { slide = Array.prototype.filter.call( e.target.swiper.wrapperEl.children, (element) => element.classList.contains('woodmart-loaded') && element.nextElementSibling ? element.nextElementSibling : null ).shift(); } load(slide); }); }); function load(activeSlide) { if (activeSlide && activeSlide.nextElementSibling) { activeSlide.nextElementSibling.classList.add('woodmart-loaded'); } activeSlide.classList.add('woodmart-loaded'); activeSlide.closest('.wd-carousel').querySelectorAll('[id="' + activeSlide.id + '"]').forEach( function (slide) { slide.classList.add('woodmart-loaded'); }); } }; window.addEventListener('load',function() { woodmartThemeModule.sliderLazyLoad(); woodmartThemeModule.sliderAnimations(); });
[-] view3d.min.js
[edit]
[-] videoPoster.min.js
[edit]
[-] banner.js
[edit]
[-] button.min.js
[edit]
[-] button.js
[edit]
[-] slider.min.js
[edit]
[-] googleMap.js
[edit]
[-] imageGallery.min.js
[edit]
[-] countDownTimer.min.js
[edit]
[-] infoBox.js
[edit]
[-] videoElement.min.js
[edit]
[-] toggle.min.js
[edit]
[-] videoPoster.js
[edit]
[-] compareImages.js
[edit]
[-] imageGallery.js
[edit]
[-] countDownTimer.js
[edit]
[-] accordion.js
[edit]
[-] counter.min.js
[edit]
[-] menuAnchor.js
[edit]
[-] hotSpot.js
[edit]
[-] stickyColumns.min.js
[edit]
[-] offCanvasColumnBtn.js
[edit]
[-] counter.js
[edit]
[-] googleMap.min.js
[edit]
[-] contentPopup.min.js
[edit]
[-] menuAnchor.min.js
[edit]
[-] accordion.min.js
[edit]
[-] compareImages.min.js
[edit]
[-] toggle.js
[edit]
[-] tabs.js
[edit]
[-] buttonShowMore.js
[edit]
[+]
..
[-] offCanvasColumnBtn.min.js
[edit]
[-] tabs.min.js
[edit]
[-] videoElementPopup.min.js
[edit]
[-] videoElementPopup.js
[edit]
[-] stickyColumns.js
[edit]
[-] openStreetMap.min.js
[edit]
[-] stockStatus.min.js
[edit]
[-] hotSpot.min.js
[edit]
[-] stockStatus.js
[edit]
[-] view3d.js
[edit]
[-] slider.js
[edit]
[-] banner.min.js
[edit]
[-] buttonShowMore.min.js
[edit]
[-] videoElement.js
[edit]
[-] infoBox.min.js
[edit]
[-] openStreetMap.js
[edit]
[-] contentPopup.js
[edit]