javascript 如何在悬停时不停止猫头鹰旋转木马?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32860928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 15:49:45  来源:igfitidea点击:

How not to stop owl carousel on hover?

javascriptjqueryowl-carouselsliders

提问by Dana

Currently the carousel stops when you hover it, I've added autoplayHoverPause:falsebut it doesn't seem to change anything. Is there another option that I could use to stop it from stopping when it's hovered?

目前,当您将其悬停时,轮播会停止,我已添加,autoplayHoverPause:false但它似乎没有任何改变。有没有其他选项可以用来阻止它在悬停时停止?

$('.owl-carousel').owlCarousel({
    autoplayHoverPause:false,
    loop:true,
    margin:0,
    nav:true,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:2
        },
        1000:{
            items:4
        }
    }
});

回答by contendia

As j.rey noted, it seems stopOnHoveris the correct way to start/stop autoplay on hover per the specs on this page:

正如 j.rey 所指出的,stopOnHover根据此页面上的规范,似乎是在悬停时启动/停止自动播放的正确方法:

http://owlgraphic.com/owlcarousel/#customizing

http://owlgraphic.com/owlcarousel/#customizing

I don't see any reference to autoplayHoverPausein the docs. Maybe that was an older version?

autoplayHoverPause在文档中没有看到任何引用。也许那是旧版本?

回答by Smrity Ray

Just add stopOnHover:truein your script.

只需在脚本中添加stopOnHover:true 即可

回答by Anjith K P

set autoplayHoverPause:false

autoplayHoverPause:false

Fiddle

小提琴

回答by ddd

stopOnHover:true https npmjs.com package react-owl-carousel

stopOnHover:true https npmjs.com 包 react-owl-carousel

回答by Rumit Patel

stopOnHover:true https npmjs.com package react-owl-carousel

stopOnHover:true https npmjs.com 包 react-owl-carousel

Use mouseDrag : false,

使用 mouseDrag : false,

回答by Chirag Makwana

You can try to modify hover csswhich is created through owl.carousle.js

您可以尝试修改css通过创建的悬停owl.carousle.js

<script>
$(".owl-wrapper-outer").mouseover(function(){
                $('.owl-wrapper').css({
                "-webkit-transition": "",
                "-moz-transition": "",
                "-o-transition": "",
                "transition": "",  
                    });

                });
</script>