Я пытаюсь заставить сову работать в верхней части моей веб-страницы. Это было бы похоже на раздел новостей с прокруткой. При нажатии на навигацию появится новый элемент.
Это выглядит примерно так:
Это мой код:
$(document).ready(function(){
$(".owl-carousel").owlCarousel();
});
jQuery(function($) {
"use strict";
$(".breaking").owlCarousel({
loop:true,
animateIn: 'fadeIn',
autoplay:true,
autoplayTimeout:3000,
autoplayHoverPause:true,
nav:true,
margin:30,
dots:false,
mouseDrag:false,
slideSpeed:500,
navText: ["<i class="fas fa-angle-left"></i>", "<i class="fas fa-angle-right"></i>"],
items : 1,
responsive:{
0:{
items:1
},
600:{
items:1
}
}
});
}
:root {
--main-accent: #f2552c;
}
.top-bar {
background-color: #f2f2f2;
border-bottom: 1px solid #e2e0e0;
padding-top: 7px;
}
.top-bar .breaking-title {
width: 200px;
}
.top-bar .breaking-title h6 {
background: var(--main-accent);
text-transform: uppercase;
color: #ffffff;
padding: 5px 10px;
font-size: 13px;
width: 123px;
margin-right: 15px;
}
.post-content {
/*z-index: 1;*/
/*position: relative;*/
}
.top-bar .post-content {
padding: 0;
}
.breaking .post-title.title-small {
font-weight: 400;
margin: 0;
font-size: 14px;
line-height: 20px;
}
.breaking .post-title a {
color: #333333;
}
.breaking .post-title a:hover {
text-decoration: none;
}
/* Carousel navigation */
.owl-carousel.owl-theme.breaking .owl-nav {
position: absolute;
right: 0;
top: -3px;
margin: 0;
}
.owl-carousel.owl-theme.breaking .owl-nav > div {
background: var(--main-accent);
border: 0;
color: #fff;
}
.owl-carousel.owl-theme .owl-nav > div {
margin: 0 3px;
width: 20px;
height: 20px;
line-height: 20px;
padding: 0;
border-radius: 0;
text-align: center;
font-size: 12px;
-webkit-transition: 400ms;
-moz-transition: 400ms;
-o-transition: 400ms;
transition: 400ms;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wrapper">
<div class="top-bar">
<div class="container">
<div class="row">
<div class="col-md-8 d-flex breaking-news-bar">
<div class="breaking-title"><h6>Breaking news</h6></div>
<div id="breaking" class="owl-carousel owl-theme owl-loaded breaking">
<div class="owl-stage-outer">
<div class="owl-stage" style="transform: translate3d(-3420px, 0px, 0px); transition: all 0s ease 0s; width: 7980px;">
<div class="owl-item cloned" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">Soaring through Southern Patagonia with the</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item cloned" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">Super Tario Run isn’t groundbreaking, but it</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">The best MacBook Pro alternatives in 2017</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item animated owl-animated-in fadeIn active" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">Soaring through Southern Patagonia with the</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">Super Tario Run isn’t groundbreaking, but it has</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item cloned" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">The best MacBook Pro alternatives in 2017</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
<div class="owl-item cloned" style="width: 1110px; margin-right: 30px;">
<div class="item">
<div class="post-content">
<h2 class="post-title title-small">
<a href="#">Soaring through Southern Patagonia with the</a>
</h2>
</div><!-- Post content end -->
</div>
</div>
</div>
</div>
<div class="owl-nav">
<div class="owl-prev"><i class="fas fa-angle-left"></i></div>
<div class="owl-next"><i class="fas fa-angle-right"></i></div>
</div>
<div class="owl-dots disabled"></div>
</div> <!-- End breaking-news -->
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div> <!-- End top-bar -->
<div class="header-content">
<div class="container">
</div>
</div> <!-- End header-content -->
<div class="main-navigation">
<div class="container">
</div>
</div> <!-- End main-navigation -->
</div> <!-- End wrapper -->
Когда я нажимаю на значки навигации, слайд не меняется. Любая помощь приветствуется, спасибо.