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>更多推荐
发布评论