javascript - owl carousel 不适用于 bootstrap RTL 3(阿拉伯语)

标签 javascript jquery html twitter-bootstrap owl-carousel

我添加了 owl carousel在我的项目中 bootstrap 3 arabic像这样

HTML

<div class="container">
    <div class="row">
        <div class="col-sm-6">
            <div class="owl-carousel">
                <img class="owl-lazy" data-src="http://placehold.it/350x250&text=1" data-src-retina="http://placehold.it/350x250&text=1-retina">
                <img class="owl-lazy" data-src="http://placehold.it/350x250&text=2" data-src-retina="http://placehold.it/350x250&text=2-retina">
                <!-- other images -->
            </div>
        </div>
    </div>
</div>

JS

$('.owl-carousel').owlCarousel({
    items: 4,
    lazyLoad: true,
    loop: true,
    margin: 10
});

但是 Owl Carousel 不适用于阿拉伯语 Bootstrap 并且不显示任何图像。
我该如何解决这个问题?

fiddle DEMO

最佳答案

添加选项 - rtl:true

http://www.owlcarousel.owlgraphic.com/demos/rtl.html

http://jsfiddle.net/soledar10/6ef5p1u1/18/

$('.owl-carousel').owlCarousel({
  items: 4,
  lazyLoad: true,
  loop: true,
  margin: 10,
  rtl: true
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<link href="http://servu.besaba.com/bootstrap-rtl.css" rel="stylesheet" />
<div class="container">
  <div class="row">
    <div class="col-sm-6">
      <div class="owl-carousel">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=1" data-src-retina="http://placehold.it/350x250&text=1-retina" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=2" data-src-retina="http://placehold.it/350x250&text=2-retina" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=3" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=4" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=5" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=6" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=7" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=8" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=9" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=10" alt="">
        <img class="owl-lazy" data-src="http://placehold.it/350x250&text=11" alt="">
      </div>
    </div>
  </div>
</div>

关于javascript - owl carousel 不适用于 bootstrap RTL 3(阿拉伯语),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30680704/

相关文章:

javascript - 具有自定义过滤功能的 AngularJS 多重过滤器

javascript - 类型 'true' 的参数不可分配给类型的参数

jquery - 根据剑道网格中的另一个单元格值更新单元格值asp.net mvc

javascript - 如何通过 File API 执行 json 文件中的数据?

javascript - 使用 onClick 函数获取 ID 并将其填充到不同的 html 上

javascript - Chrome 版本 57.0.2987 中的 chrome.runtime.sendMessage 错误

jquery - 如何从 jquery 访问表格单元格

javascript - CSS 溢出 : ? ???和表或其他一些方法?

javascript - 如何从 Animate CC 2015 获取不使用 jquery 的 Canvas 元素

javascript - 使用 D3.js 库更改桑基图中节点的颜色。