bxslider calculating wrong viewport size on load

前端 未结 6 1497
醉梦人生
醉梦人生 2021-02-07 05:06

Anyway I recently started using bxslider and I\'m having an issue with it.

It seems to calculate its viewport size wrongly on page load, which means it doesn\'t work we

6条回答
  •  孤街浪徒
    2021-02-07 05:53

    If you are loading the

      element with ajax and it contains images, try slider.reloadSlider(); after the load. First I used

      setTimeout('slider.reloadSlider()',1000);
      

      to wait for the images to load, but eventually I switched to the nice library ImagesLoaded that will wait for the images to load:

      imagesLoaded('.seminars-slider', function() {
         slider.reloadSlider();
      });
      

      (changed the variable-names to match those of the question)

提交回复
热议问题