• Resolved sybakhar

    (@sybakhar)


    Hello, thanks for this gread plugin – i really love the simple & powerfull slider! ??

    But today i realised, that the slider got some problems and i have no idea where they come from; im really just a novice in wordpress & this whole stuff ((:

    So on one page, i use 3 different slider blocks and they worked fine for weeks, but toady i saw, that only the first one is working correctly – the second & third are not moving (auto oder manual) and the description is stuck at the left top.

    i thought maybe it is caused by my wp optimize plugin, caching or minimizing – but after disabling the complete puglin nothing changed.
    i tryed the slider on another page, added three sliders and there, everyone works fine.

    On the console i got the following message (only on the problem page, not the test page mention above):

    Uncaught RangeError: Invalid array length
        at script.js:80:42
        at Array.map (<anonymous>)
        at script.js:64:16
        at Array.map (<anonymous>)
        at HTMLDocument.<anonymous> (script.js:9:30)

    I hope for fast help & thank you very much,
    daniel (:

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sybakhar

    (@sybakhar)

    update – i tested a few things;
    first slider got 54, second got 9 & third got 16slides – the problem seems to come from the “huge” number of slides on one site; cause when i change the orders of the three, the thirst always works – but how can i solve this? ((:

    Plugin Author Charles Cormier

    (@charlescormier)

    Hi @sybakhar,
    Please deactivate all the plugins and clear the cache. Try to see in incognito or different browsers.
    Thank you!

    Thread Starter sybakhar

    (@sybakhar)

    Hello @charlescormier ,
    i already tried this, but nothing changes – still the error “uncaught RangeError: Invalid array lengh” on console which links to the following code:

    !function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}document.addEventListener("DOMContentLoaded",(function(){var t=document.querySelectorAll(".wp-block-csb-content-slider-block");Object.values(t).map((function(t){var n=document.getElementById(t.id),o=function(e,t){return 100*parseFloat(e/t)},r=function(e){return parseInt(null==e?void 0:e.clientWidth)},i=function(e){return parseInt(null==e?void 0:e.clientHeight)},l=JSON.parse(n.dataset.slider),a=l.slides,c=l.columns,s=l.columnGap,d=l.isLoop,u=l.isTouchMove,p=l.isAutoplay,f=l.speed,v=l.effect,b=l.isPageClickable,m=l.isPageDynamic;new Swiper("#".concat(t.id," .csbContentSlider"),{direction:"horizontal",slidesPerView:null==c?void 0:c.mobile,breakpoints:{576:{slidesPerView:null==c?void 0:c.tablet},768:{slidesPerView:null==c?void 0:c.desktop}},spaceBetween:s,loop:d,allowTouchMove:u,grabCursor:u,autoplay:!!p&&{delay:1e3*f},speed:1e3*f,effect:v,fadeEffect:{crossFade:!0},creativeEffect:{prev:{shadow:!0,translate:["-120%",0,-500]},next:{shadow:!0,translate:["120%",0,-500]}},allowSlideNext:!0,allowSlidePrev:!0,autoHeight:!1,notificationClass:null,pagination:{el:".swiper-pagination",clickable:b,dynamicBullets:m},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}});var y=document.querySelector("#".concat(t.id," .csbContentSliderStyle")),h="";a.map((function(n,l){for(var a=n.position,c=n.childPositions,s=void 0===c?[{left:5.8,top:11},{left:5.8,top:22},{left:5.8,top:33}]:c,d=a,u=document.querySelector("#".concat(t.id," .csbContentSlider .slide-").concat(l,":not(.swiper-slide-duplicate) .sliderContent")),p=(null==u?void 0:u.children)||[],f=function(e,t,n){s[e].top=parseFloat(t),s[e].left=parseFloat(n)},v=e(Array(null==p?void 0:p.length).keys()).reverse(),b=Math.ceil((null==p?void 0:p.length)/2-1),m=e(Array(b).keys()).reverse(),g=0;g<p.length;g++){var w=o(r(p[g]),r(u)),S=o(i(p[g]),i(u));if(0<w&&0<S&&isFinite(w)&&isFinite(S)){var F=5.8,A=parseFloat((50-w/2).toFixed(3)),C=parseFloat((100-w-F).toFixed(3)),x=11*(g+1),k=g===b?50:g<b?50-11*(m[g]+1):50+11*(g-b),E=parseFloat((k-S/2).toFixed(3)),P=parseFloat((100-11*(g+1)-S).toFixed(3));"top left"===d?f(g,x,F):"top center"===d?f(g,x,A):"top right"===d?f(g,x,C):"center left"===d?f(g,E,F):"center center"===d?f(g,E,A):"center right"===d?f(g,E,C):"bottom left"===d?f(v[g],P,F):"bottom center"===d?f(v[g],P,A):"bottom right"===d&&f(v[g],P,C)}}for(var I=0;I<p.length;I++)s[I]=s[I]||{left:5.8,top:11*(I+1)},h+="#".concat(t.id," .csbContentSlider .slide-").concat(l," .sliderContent > *:nth-child(").concat(I+1,"){ top: ").concat(s[I].top,"%; left: ").concat(s[I].left,"%; } ");y.innerText=h})),null==n||n.removeAttribute("data-slider")}))}))}();

    -> This is the code, with wp optimize enabled – but as i already wrote, even i disable the js minimizing, clear all cache, etc, the problem is the same.

    Regards,
    Daniel

    Plugin Author Charles Cormier

    (@charlescormier)

    Hi @sybakhar,
    Please go to the backend of the page and update the post without any change. Then see in the frontend. And let us know.
    Thank you!

    Thread Starter sybakhar

    (@sybakhar)

    Hello,
    thanks for the advice – problem still is the same.
    For me, i switched to another content slider so if you wanna close the thread, its ok – if you want to investigate further, im here to help ??
    Regards (:

    Plugin Author Charles Cormier

    (@charlescormier)

    Hi @sybakhar,
    The problem is only happening with you and as you said you switched to another content slider. so we can close.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘uncaught rangeerror: invalid array lengh’ is closed to new replies.