• Resolved nicmare

    (@nicmare)


    I am looking for a tutorial on how to use FlyingScripts for scripts like Lightboxes or Slideshows. They are working fine for me but as soon as i load them through FlyingScripts, i get console errors like “Uncaught ReferenceError: Splide is not defined”. Therefore i wonder how to rewrite the code.

    Is there a specific event like “DOMContentLoaded” to handle that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gijo Varghese

    (@gijo)

    @nicmare you’ve delay all JS files and inline scripts related to the Splide.

    Thread Starter nicmare

    (@nicmare)

    Yes exactly but do you provide a sample snippet or documentation how to do this ? With setTimeout function ?

    Thread Starter nicmare

    (@nicmare)

    after analyzing your code which simply uses a settimeout function, i simply use that as well in my custom script with 100ms delay. If someone else is looking for this, simply wrap your code (which is lazy loaded by flyingscript) like this:

    setTimeout(function(){
    let lg_gallery = document.querySelector('#hero');
    if(document.querySelector('.splide')){
    var splide_single = new Splide( '.splide',{
    type : 'slide',
    perPage: 1,
    lazyLoad: "nearby",
    pagination: false,
    focusableNodes: 'a, button, textarea, input, select, iframe, span, img'
    } );}

    },100);

    this is an example code with splidejs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Specific Events to trigger Lightbox Scripts?’ is closed to new replies.