Bootstrap轮播没有初始化(Bootstrap carousel not initializing)

编程入门 行业动态 更新时间:2024-10-27 02:23:31
Bootstrap轮播没有初始化(Bootstrap carousel not initializing)

在班级carouse-内部动态添加

<div class = "active item"><img ..></div> <div class = "item"><img ..></div> <div class = "item"><img..</div>

并打电话

$('.carousel').carousel();

在inspect元素中,carousel html是正确的,但在箭头上滑动点击不起作用。 我认为bootstrap carousel不是init。

in the class carouse-inner dynamic adding

<div class = "active item"><img ..></div> <div class = "item"><img ..></div> <div class = "item"><img..</div>

and call

$('.carousel').carousel();

In inspect element, carousel html is correct, but slide on arrows click not working. I think bootstrap carousel not init.

最满意答案

尝试用这个替换你当前的bootstrap和jquery <script> 。 把它放在</body>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://code.jquery.com/jquery.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>

Try to replace your current bootstrap and jquery <script> with this. Place this before the </body>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://code.jquery.com/jquery.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>

更多推荐

本文发布于:2023-08-01 17:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1362233.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   Bootstrap   initializing   carousel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!