• Resolved oceandigitals

    (@oceandigitals)


    Hello,

    When I enabled the plugin my slider (swiperjs) in the homepage stopped working…

    Maybe is there any javascript that interfere with the slider?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Erik

    (@codekraft)

    AFAIK no, lately I’ve been using swiper.js (a custom implementation) in my websites, and I’ve never encountered any issue. Maybe a conflict with that plugin?
    Do you have a possibility to check the error log so that we can identify the issue? Alternatively I will try to check in as soon as I can, thanks for the report in the meantime!

    Thread Starter oceandigitals

    (@oceandigitals)

    Please you can take a look here, in my staging website: https://dev.danphotostudio.com/

    It should look like this: https://danphotostudio.com/

    thank you!

    Plugin Author Erik

    (@codekraft)

    This could be related to the swiper init that uses window.onload while document.onload is the right way, can you give a try replacing window with document in genpress_child/assets/js/swiper-setup.js? let me know

    Thread Starter oceandigitals

    (@oceandigitals)

    Hello,

    I tried but it seems that swiper don’t work with document.onload…

    also with your plugin disabled

    Plugin Author Erik

    (@codekraft)

    As far as i can test the load event is never fired, which is why I was suggesting you change it… furthermore, it seems that at that time the antispam script is not yet loaded, so I don’t think the issue is related to that.

    I see that you load the script very early in the header, could you try moving it to the footer? It could be that the page is not fully loaded at that time (or use DOMContentLoaded)

    Thread Starter oceandigitals

    (@oceandigitals)

    Hi @codekraft

    I solved it using:

    window.addEventListener("load",function(event) {
    
    //code
    
    },false);
    Thread Starter oceandigitals

    (@oceandigitals)

    Sorry,

    I thought I have solved it, but was only the cache…

    The issue is still present…

    Plugin Author Erik

    (@codekraft)

    I tried to look at the dev site but unfortunately it is not online now. however if it can help you here you find how I integrated swiper into my template
    https://github.com/erikyo/modul-r/blob/WIP/fse/src/scripts/user/slider.ts

    The problem, from what I had been able to see is that the script was being called so early that the body had not yet been loaded.
    That’s why I suggest you use DOMContentLoaded like here or move your custom swiper init to the footer (without event listener because at that time everything will already be loaded)

    Thread Starter oceandigitals

    (@oceandigitals)

    It seems that DOMContentLoaded did the trick!

    thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The plugin interfered with my homepage slider’ is closed to new replies.