ReplaceWith carousel-inner with new items

偶尔善良 提交于 2019-12-11 03:34:52

问题


Community :-)

this is my first Question. There are similar but I have a very special problem. I try to change the items of an bootstrap carousel on demand - but it frozes after that. If I do, it shows the first active but I cannot use the slide buttons and indicators. I the Demo I have triggered the replacement with setTimeout 10 Seconds. So you can see 10 Seconds the static coded items and after that it will be replaced by JQuery ReplaceWith.

Is there a refresh command or similar ?


回答1:


I tested with your linked code and figured out you have to replaceWith the hole

< div class="view">

including the carousel-control links. Also I replaced the #carousel-363119 in your for loop.

That way jquery works like we add a hole new carousel.



来源:https://stackoverflow.com/questions/29719344/replacewith-carousel-inner-with-new-items

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