P.now("premium-aplus-13-carousel-4").execute(function(init) { if (init) { return; } P.register("premium-aplus-13-carousel-4". function(){ return function() { P.when("A". "jQuery". "a-carousel-framework". "ready").execute(function (A. $. framework) { var moduleId = "4"; var carouselName = "premium-aplus-13-carousel-4"; var paginationAction = "aplus-pagination-dot-action-" moduleId; var paginationGroup = "#aplus-pagination-group-" moduleId "-" carouselName; const ENTER_KEY_CODE = 13; const ESCAPE_KEY_CODE = 27; /* If the carousel goes to a new page */ A.on("a:carousel:" carouselName ":change:pageNumber". function (data) { A.$(paginationGroup " .carousel-slider-circle").removeClass("aplus-carousel-active").attr('aria-selected'. 'false') .eq(data.newValue - 1).addClass("aplus-carousel-active").attr('aria-selected'. 'true'); }); framework.onInit(carouselName. function (carousel) { A.declarative(paginationAction. 'click keydown'. function(event){ var isClick = event.type === 'click'; var isKeydown = event.type === 'keydown'; var isEnter = isKeydown && event.$event.keyCode === ENTER_KEY_CODE; var isEsc = isKeydown && event.$event.keyCode === ESCAPE_KEY_CODE; if (isClick || isEnter) { var data = event.data; carousel.gotoPage(data.page); } else if (isEsc) { // force remove focus event.$target.blur() } }); }); }); } });});
Reviews
There are no reviews yet.