我试图安装猫头鹰旋转木马2在我的网站。我已经添加了以下文件猫头鹰旋转木马。
<script src="~/Scripts/jquery-3.1.1.min.js" defer></script>
<script src="~/Scripts/js/owl-carousel.js"defer></script>
<link rel="stylesheet" href="~/Content/css/owl.carousel.css">
添加了以下函数来调用Jquery
$(".owl-demo").owlCarousel({
items: 2,
itemsDesktop: [1199, 2],
itemsDesktopSmall: [979, 3],
pagination: false,
rewindNav: false,
slideBy: 2,
scrollPerPage: true,
afterAction: function () {
if (this.itemsAmount > this.visibleItems.length) {
$('.next').show();
$('.prev').show();
$('.next').removeClass('disabled');
$('.prev').removeClass('disabled');
if (this.currentItem == 0) {
$('.prev').addClass('disabled');
}
if (this.currentItem == this.maximumItem) {
$('.next').addClass('disabled');
}
} else {
$('.next').hide();
$('.prev').hide();
}
}
});
$(".next").click(function () {
$(".owl-demo").trigger('owl.next');
})
$(".prev").click(function () {
$(".owl-demo").trigger('owl.prev');
})
添加了以下HTML代码
<div class="carousel">
<div class="owl-demo owl-carousel">
<div class="item">
<img src="~/Images/slider-img.png" />
<div class="img-title">text will come here</div>
</div>
<div class="item">
<img src="~/Images/slider-img.png" />
<div class="img-title">text will come here</div>
</div>
<div class="item">
<img src="~/Images/slider-img.png" />
<div class="img-title">text will come here</div>
</div>
<div class="item">
<img src="~/Images/slider-img.png" />
<div class="img-title">text will come here</div>
</div>
</div>
<div class="customNavigation">
<a id="customnavi1" class="btn prev">
<img src="~/lib/images/BackButtonBlack.PNG" />
</a>
<a id="customnavi2" class="btn next">
<img src="~/lib/images/NextArrowBlack.PNG" />
</a>
</div>
</div>
但仍面临以下问题
我不知道为什么它会返回这个错误。
1条答案
按热度按时间xzv2uavs1#
这是你要的演示