lory-8.x-1.x-dev/js/features/lory.feature.dots.min.js

js/features/lory.feature.dots.min.js
!function(t){"use strict";var e=lory.prototype;e.attachEvents=function(e){return function(){var r=this;if(r.$dots=r.$slider.querySelector(".lory__dots"),r.count>1&&r.options.dots===!0){var n={"before.lory.init":r.dotBuild,"after.lory.init":r.dotInit,"after.lory.slide":r.dotChange};t.forEach(n,function(t,e){r.$slider.addEventListener(e,t.bind(r),!1)})}return e.call(this)}}(e.attachEvents),e.dotBuild=function(t){var e=this,r=e.$dots;if(0===r.children.length){for(var n=document.createDocumentFragment(),i=0;i<e.count;i++){var o=document.createElement("li");o.textContent=i,n.appendChild(o)}r.appendChild(n),r.classList.remove("visually-hidden")}},e.dotInit=function(t){var e=this,r=e.$dots.childNodes;r[e.currentSlide].classList.add(e.currClass);for(var n=0;n<e.count;n++)r[n].addEventListener("click",function(t){var n=Array.prototype.indexOf.call(r,t.target);e.currentSlide=n,t.target.classList.contains(e.currClass)||e.slideTo(n)})},e.dotChange=function(t){for(var e=this,r=e.$dots.childNodes,n=0;n<e.count;n++)r[n].classList.remove(e.currClass);r[t.detail.currentSlide-1].classList.add(e.currClass)}}(dBlazy);

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc