2

我已经尝试交换 owl.carousel.js 上的功能,但它仅在鼠标移动时才有效。

var Autoplay = function(scope) {
this.core = scope;
this.core.options = $.extend({}, Autoplay.Defaults, this.core.options);

this.handlers = {
    'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() {
        this.autoplay();
    }, this),
    'play.owl.autoplay': $.proxy(function(e, t, s) {
        this.play(t, s);
    }, this),
    'stop.owl.autoplay': $.proxy(function() {
        this.stop();
    }, this),
    'mouseover.owl.autoplay': $.proxy(function() {
        if (this.core.settings.autoplayHoverPause) {
            this.pause();
        }
    }, this),
    'mouseleave.owl.autoplay': $.proxy(function() {
        if (this.core.settings.autoplayHoverPause) {
            this.autoplay();
        }
    }, this)
};

this.core.$element.on(this.handlers);};

知道当鼠标放在图像顶部时如何使幻灯片正常工作吗?

4

1 回答 1

0

当我遇到这个问题时,我使用了这个代码:

$('.owl-carousel .owl-dot').hover(function() {
$(this).click();
},
function() {}
);

这里是我的点 css:
.owl-dot{
position: relative;
填充:0;
高度:3px;
边距:0;
向左飘浮;
}
.owl-dot:before{
内容:“”;
位置:绝对;
顶部:-168 像素;
// 图片高度 height: 168px;
// 图像宽度的高度:100%;
左:0;
z-index:0;
}

当您将鼠标悬停在点上时,图像会发生变化,仅此而已!

于 2017-04-10T12:40:58.117 回答