Jssor slider - How do I destroy and recreate Jssor slider with different content

后端 未结 4 1200
独厮守ぢ
独厮守ぢ 2021-01-13 09:49

I\'m trying to use Jssor slider to show different HTML content depending on selected category and its subcategory. I successfully created content slider for one subcategory,

4条回答
  •  逝去的感伤
    2021-01-13 10:16

    I had the same requirement and after some head scratching got it to work (for my requirements at least).

    Using .remove() method removes the selected element(s) and its child elements. Which removed all the slide markup inside this element.

    As such when calling this, I needed to create and populate the basic child elements (again) and append to the container. $("#slider1_container").append(theOriginalHtmlMarkup).

    Having done this I was able to repopulate the slider with the newly fetched data.

提交回复
热议问题