猫头鹰旋转木马滑块不与rtl一起工作

Mik*_*tta 0 html owl-carousel

我对猫头鹰旋转木马滑块有问题.

当我的html页面打开标记为:时<html>,滑块工作正常,我可以看到图像.

但是当我的页面打开时:<html dir="rtl">,滑块不工作,我的意思是我看到箭头和分页,但不是图片本身:

这是我的代码:

$("#owl-demo").owlCarousel({
            navigation : false,
            rtl:true,
            slideSpeed : 300,
            paginationSpeed : 400,
            singleItem:true
          });
Run Code Online (Sandbox Code Playgroud)

有什么帮助吗?

小智 9

将此代码放在css文件中

.owl-carousel,
.bx-wrapper { direction: ltr; }
.owl-carousel .owl-item { direction: rtl; }
Run Code Online (Sandbox Code Playgroud)


P-S*_*P-S 5

无需在任何地方手动添加自定义 CSS 规则(尤其是那个方向:ltr)...

猫头鹰旋转木马 v2.3.4

$('.owl-carousel').owlCarousel({
    rtl:true // add this to the rest of the options
});
Run Code Online (Sandbox Code Playgroud)

添加后,Owl Carousel 会自动将“ owl-rtl ”类附加到 carousel HTML 元素,然后插件的 CSS 规则将自动触发rtl功能。


小智 3

在你的 JS 中,只需输入rtl: true. 这对我有用。

$id.owlCarousel({
    items: 1,
    nav: false,
    dots: true,
    autoplay: true,
    rtl: true
});
Run Code Online (Sandbox Code Playgroud)