bxslider not working properly for dynamically loaded content

為{幸葍}努か 提交于 2019-12-01 06:25:19

问题


Had to use bxslider for one of the app. I have some issues while trying to implement bxslider with dynamically loaded content over ajax.

It works abruptly. Interestingly when there is a slight change in view port either by opening dev tools or window size change, it does sometime works.

Would just like to understand has anyone faced this issue before and what could be the workaround.

Thanks


回答1:


BxSlider now contains two new methods:

  • reloadSlider()
  • destroySlider()

After loading new content into your slider, try calling reloadSlider(), as this will re-initialize the slider and accomodate the new slides.

Check here for code examples:

  • http://bxslider.com/examples/reload-slider
  • http://bxslider.com/examples/reload-slider-settings


来源:https://stackoverflow.com/questions/14196358/bxslider-not-working-properly-for-dynamically-loaded-content

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!