JavaScript - page has to be refreshed to show particle-slider logo effect

后端 未结 5 1129
旧时难觅i
旧时难觅i 2020-12-22 11:21

I\'m loading a front-end site from Wordpress using a HTML 5 Blank Child Theme. I have a logo effect using particle slider for when I have a screen size of >960px; for screen

5条回答
  •  一向
    一向 (楼主)
    2020-12-22 12:22

    The Problem is the following: The slider draws with js into the canvas, seems like the script is loaded once on page load... The slider shall be responsive as the athors say on their site, but in fact the slider is just resized and not replayed on window resize...

    To me it seems like calling

    ps.nextSlide(0);
    

    on $(window).resize() could help. This reloads the current slide!

    If this does not work too, try to reload the whole slider with the init() function or maybe the loadingStep() function! (The documentation is sadly not that clear to me at some points...)

    i.e.:

    $(window).resize(function(){
        ps.nextSlide(0);
    });
    

    You can see the functions availeble here:

    http://particleslider.com/documentation/reference

提交回复
热议问题