[blog]:是否可以这样写

$("#owl-demo").owlCarousel({
    navigation: true,
    slideSpeed: 300,
    paginationSpeed: 400,
    singleItem: true,
    paginationhover: true//is it possible to write like that or not
});

最佳答案

我花了两天时间,但没有找到解决此问题的论坛。最后,我通过我编写的快捷功能完成了此任务。希望对您有帮助。请检查代码并根据您的要求进行修改。

var slidercarousel = $(".owl-carousel");
  slidercarousel.owlCarousel({
    navigation : false,
    pagination : true,
    slideSpeed : 300,
    paginationSpeed : 400,
    singleItem : true,
    lazyLoad   : true,
    lazyFollow : true,
    lazyEffect  : "fade",
    autoPlay    : true,
    stopOnHover : true,
    addClassActive : true,
    afterInit: makePages,
    afterUpdate: makePages
  });

$( ".myslider" ).mouseover(function() {
    slidercarousel.trigger('owl.goTo', this.id);
    $('.myslider').removeClass('slider_active');
    $(this).addClass('slider_active');
  });

function makePages() {
    $.each(this.owl.userItems, function(i) {
    $('.owl-controls .owl-page').eq(i)
            .html("<div class='myslider' id='"+i+"'>"+$('.figureCaption'+i).html()+"</div>")
    });
  }


活动项目的CSS

<style>
.home-page-slider .owl-controls .owl-pagination .active{
border-bottom: 4px solid rgb(161, 206, 42);
 }
</style>


对于演示,请通过此链接进行检查。
http://digishoppers.com/newhomepage

09-10 10:48
查看更多