简体   繁体   English

引导轮播下一个和上一个图像不显示

[英]bootstrap carousel next and previous images not displaying

im working on bootstrap carousel which displaying images from database.Now i need to use this to display next and previous images as well in the same container.carousel is working fine but its not displaying next and prev images in it i tried This . 我正在处理引导轮播,该轮播显示来自数据库的图像。现在,我需要使用它来在同一容器中显示下一个和上一个图像。轮播工作正常,但它不显示下一个和上一个图像,所以我尝试了这个 But getting Image as given below. 但是获得图像如下。 Thank you for answer. 谢谢你的答案。

Output image is given. 给出输出图像。 Output im getting 输出即时

  $(document).ready(function(){ $scope.vehicleImageList = {}; $http.get('http://localhost:8087/mmg/api/v1/franchisevehicleimages/'+$scope.source, { headers: { XXXXXXXXXXXXXXXXx } }).then(function (results2) { $scope.vehicleImageList = results2.data.data; }); $(function(){ $('.carousel-control').click(function(e){ e.preventDefault(); $('#myCarousel').carousel( $(this).data() ); }); }) }); 
 .carousel, .carousel-inner, .carousel-inner > .item { overflow: hidden; } .carousel-inner:before { position:absolute; top:0; bottom: 0; right: 82%; left: 0; content:""; display:block; background-color: #fff; z-index: 2; } .carousel-inner:after { position:absolute; top:0; bottom:0; right: 0; left: 82%; content:""; display:block; background-color:#fff; z-index: 2; } .carousel-control.left, .carousel-control.right { background: initial; width: 30%; color: #000; z-index: 10; top: -10px; } 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!-- image carousel --> <div class="row"> <div class="item form-group"> <div class="col-md-11"> <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false"> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item" ng-class="{active:!$index}" ng-repeat="list in vehicleImageList | unique:'name'"> <img src="./src/images/{{list.name}}" alt="Vehicle" style="height:150px;width:250px"> <!-- <div class="carousel-caption" style="color:black"> <h3 class="h3-responsive">Light mask</h3> <p>First text</p> </div> --> </div> <!-- Left and right controls --> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span> </a> </div> </div> </div> </div> </div> 

It easily can do using bootstrap. 使用引导程序很容易做到。

see following code: 请参阅以下代码:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Carousel Example</h2>  
  <div id="myCarousel" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
      <li data-target="#myCarousel" data-slide-to="2"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner">
      <div class="item active">
        <img src="la.jpg" alt="Los Angeles" style="width:100%;">
      </div>

      <div class="item">
        <img src="chicago.jpg" alt="Chicago" style="width:100%;">
      </div>

      <div class="item">
        <img src="ny.jpg" alt="New york" style="width:100%;">
      </div>
    </div>

    <!-- Left and right controls -->
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
</div>

</body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 引导轮播不会显示所有图像 - Bootstrap carousel not displaying all images Bootstrap Carousel 幻灯片对于“NEXT”不平滑,但对于“PREVIOUS”来说是平滑的 - Bootstrap Carousel slide is not smooth for "NEXT" but smooth for "PREVIOUS" 在Twitter Bootstrap Carousel中显示下一张和上一张图片 - Show next and previous image in Twitter Bootstrap Carousel 在 bootstrap 4 carousel 中为上一张和下一张幻灯片制作动画 - Animate previous and next slide in bootstrap 4 carousel 显示带有引导轮播的预览(上一张和下一张图片) - Showing previews (previous and next image) with bootstrap carousel 如何使twitter bootstrap 3轮播中心处于活动图像的中心,并显示下一张和上一张图像的一部分? - How can I make twitter bootstrap 3 carousel centre the active image and show part of the next and previous images? 在Bootstrap传送带中彼此相邻滑动图像 - Sliding images in Bootstrap's Carousel next to eachother 猫头鹰轮播不显示简单的html设计中的下一个上一个按钮 - Owl carousel not displaying next previous button in simple html design 单击引导轮播中的下一个或上一个时,图像会跳转 - Image jumps when click on next or previous on bootstrap carousel Bootstrap Carousel 上一个和下一个按钮不起作用 - Bootstrap Carousel previous and next buttons aren't working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM