【问题标题】:bootstrap carousel: the plugin shows me all image not slideshow引导轮播:插件向我显示所有图像而不是幻灯片
【发布时间】:2012-05-08 06:18:43
【问题描述】:

我在我的网站上使用bootstrap carousel。插件显示所有图像的问题。
请参阅jsFiddle 上的示例。

插件调用正确,因为在 Firebug 中 itemactive item 正在发生变化。
哪里出了问题?
谢谢。

【问题讨论】:

    标签: jquery twitter-bootstrap carousel


    【解决方案1】:

    你只是错过了bootstrap.css,它定义了很多东西,比如

    .carousel {
      position: relative;
      margin-bottom: 18px;
      line-height: 1;
    }
    
    .carousel-inner {
      position: relative;
      width: 100%;
      overflow: hidden;
    }
    
    .carousel .item {
      position: relative;
      display: none;
      -webkit-transition: 0.6s ease-in-out left;
         -moz-transition: 0.6s ease-in-out left;
          -ms-transition: 0.6s ease-in-out left;
           -o-transition: 0.6s ease-in-out left;
              transition: 0.6s ease-in-out left;
    }
    
    .carousel .item > img {
      display: block;
      line-height: 1;
    }
    
    .carousel .active,
    .carousel .next,
    .carousel .prev {
      display: block;
    }
    
    .carousel .active {
      left: 0;
    }
    
    .carousel .next,
    .carousel .prev {
      position: absolute;
      top: 0;
      width: 100%;
    }
    
    .carousel .next {
      left: 100%;
    }
    
    .carousel .prev {
      left: -100%;
    }
    
    .carousel .next.left,
    .carousel .prev.right {
      left: 0;
    }
    
    .carousel .active.left {
      left: -100%;
    }
    
    .carousel .active.right {
      left: 100%;
    }
    
    .carousel-control {
      position: absolute;
      top: 40%;
      left: 15px;
      width: 40px;
      height: 40px;
      margin-top: -20px;
      font-size: 60px;
      font-weight: 100;
      line-height: 30px;
      color: #ffffff;
      text-align: center;
      background: #222222;
      border: 3px solid #ffffff;
      -webkit-border-radius: 23px;
         -moz-border-radius: 23px;
              border-radius: 23px;
      opacity: 0.5;
      filter: alpha(opacity=50);
    }
    
    .carousel-control.right {
      right: 15px;
      left: auto;
    }
    
    .carousel-control:hover {
      color: #ffffff;
      text-decoration: none;
      opacity: 0.9;
      filter: alpha(opacity=90);
    }
    
    .carousel-caption {
      position: absolute;
      right: 0;
      bottom: 0;
      left: 0;
      padding: 10px 15px 5px;
      background: #333333;
      background: rgba(0, 0, 0, 0.75);
    }
    
    .carousel-caption h4,
    .carousel-caption p {
      color: #ffffff;
    }
    

    工作演示:http://jsfiddle.net/naveen/nPyKZ/

    【讨论】:

      猜你喜欢
      • 2021-01-15
      • 1970-01-01
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-02
      • 1970-01-01
      相关资源
      最近更新 更多