bxslider not working properly for dynamically loaded content

sammy_ji picture sammy_ji · Jan 7, 2013 · Viewed 10.8k times · Source

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

Answer

stevenwanderski picture stevenwanderski · Jan 28, 2013

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: