2

I am applying slick slider on the home page at widget but on page load, it is not loading properly but after page load, ends it works fine

enter image description here

and when the page loads completely it looks like this enter image description here

here is my code

<script type="text/javascript">

    require(['jquery', 'slick'], function($){ 
    jQuery(document).ready(function ($) {

           jQuery('#blog-post-silder').not('.slick- 
   initialized').slick({
      dots: false,
      infinite: false,
      speed: 300,
      slidesToShow: 3.1,
      settings: "unslick",
      slidesToScroll: 1,
      responsive: [
        {
          breakpoint: 1024,
          settings: {
            slidesToShow: 3.1,
            slidesToScroll: 1,
            infinite: false,
            dots: false
          }
        },
         {
          breakpoint:767,
          settings: {
            slidesToShow: 3.2,
            slidesToScroll: 1,
             dots: false
          }
        },
        {
          breakpoint: 600,
          settings: {
            slidesToShow: 3.1,
            slidesToScroll: 1,
             dots: false
          }
        },
           {
          breakpoint: 320,
          settings: {
            slidesToShow: 2.1,
            slidesToScroll: 1,
             dots: false
          }
        },
        {
          breakpoint: 480,
          settings: {
            slidesToShow: 2.1,
            slidesToScroll: 1,
             dots: false
          }
        }
        // You can unslick at a given breakpoint now by adding:
        // settings: "unslick"
        // instead of a settings object
      ]
       });
       });
       });
    </script>
      <ol id="blog-post-silder" class="product-items <?= /* @noEscape 
    */ $type ?>"  >

thanks a lot

  • is there any inline or internal css ?? – Waqar Ali Aug 8 '19 at 12:39
  • i have added slick slider css – Ashish Ramchandani Aug 9 '19 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.