3 回答
TA贡献1785条经验 获得超4个赞
使用这个CSS
.carousel-wrapper {
cursor: url(https://i.stack.imgur.com/VTE97.png),auto;
overflow-x: hidden;
}
$(".owl-carousel").owlCarousel();
.item {
display: flex;
justify-content: center;
align-items: center;
background: #000;
margin: 15px;
color: #fff;
height: 150px;
}
/*.owl-carousel {cursor: url(https://i.imgur.com/ZUjicmP.png), auto;}*/
/*.owl-stage-outer {cursor: url(https://i.imgur.com/ZUjicmP.png), auto;}*/
/*.owl-stage {cursor: url(https://i.imgur.com/ZUjicmP.png), auto;}*/
/*.owl-item {cursor: url(https://i.imgur.com/ZUjicmP.png), auto;}*/
.carousel-wrapper {
cursor: url(https://i.stack.imgur.com/VTE97.png),auto;
overflow-x: hidden;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.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>
<div class="carousel-wrapper">
<div class="owl-carousel">
<div class="item">0-1</div>
<div class="item">0-2</div>
<div class="item">0-3</div>
<div class="item">0-4</div>
<div class="item">0-5</div>
<div class="item">0-6</div>
</div>
</div>
TA贡献2003条经验 获得超2个赞
如果这也与拖放光标有关。您可能想要修改 owl-carousel 的样式,特别是.owl-drag和.owl-grab类。只需确保添加父<div>类 - 例如parent-div 在其之前仅应用该父类内部的修改<div>。这个对我有用。
.parent-div .owl-carousel.owl-theme.tour-packages-slider.owl-loaded.owl-drag {
cursor: grab;
}
.parent-div .owl-carousel.owl-theme.tour-packages-slider.owl-loaded.owl-grab {
cursor: grabbing;
}
添加回答
举报