gpt4 book ai didi

javascript - Twitter Bootstrap 轮播按钮不起作用

转载 作者:行者123 更新时间:2023-11-28 07:24:51 25 4
gpt4 key购买 nike

我正在尝试在我的网站中实现 bootstrap 3 轮播,但是左右滑动按钮不起作用,滑动点也不起作用。谁能发现我的代码中的问题吗?

<!doctype html> 
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript" scr="js/bootstrap.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<title>Test page! </title>
</head>


<body>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>

<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="img/deepcleaning1.jpg" alt="deepcleaning">
</div>
<div class="item">
<img src="img/deepcleaning2.jpg" alt="deepcleaning2">
</div>
</div>

<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

</body>
</html>

最佳答案

听起来像是一个类似的问题:Bootstrap Carousel does not work

那里的答案建议检查 javascript 错误,特别是 jquery 的链接。看来在 URL 中添加 http 或 https 可以解决该问题。

<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>

<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>

关于javascript - Twitter Bootstrap 轮播按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29797560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com