bxslider calculating wrong viewport size on load

前端 未结 6 1501
醉梦人生
醉梦人生 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条回答
  •  梦毁少年i
    2021-02-07 06:11

    "romelmederos" on the bxslider github page suggested;


    "BxSlider v4.1 - Having issues with the rendering of the slider since I am using percentages for the height in a responsive web site for mobile.

    So I had to make the change from: slider.viewport.css('height', getViewportHeight()); to this: slider.viewport.css('height', '');

    I altered the plugin with an option instead in my copy, but the quickest way to change is by modifying the line above"


    I edited my jquery.bxslider.js on line 1290; This worked great for me and seems a better solution than window.load, (with window.load the slider was busted until everything loaded.)

提交回复
热议问题