Issue
I am facing a challenge in responsively aligning the previous and next navigation buttons using Owl Carousel v2. I need these buttons to fit within the offset column of the centered container and maintain their overlay position down to 767px, instead of being positioned at the edge of the screen.
There is an included example fiddle below showcasing a full-width background image that remains for the first two slides only, with the center text changing and then the background changing on the third slide along with the text.
Code
HTML
<div class="background-full background-one">
<div class="carousel">
<div class="item">
<div class="container carousel-container">
<div class="row">
<div class="col-sm-5 hidden-xs col-sm-offset-1 carousel-text">
<h1>Section Title</h1>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
<button>Link</button>
</div>
<div class="col-sm-5 col-xs-12 carousel-image">
<img alt="" class="img-responsive" src="http://www.placehold.it/458x376" />
</div>
</div>
</div>
</div>
<div class="item">
<div class="container carousel-container">
<div class="row">
<div class="col-sm-5 hidden-xs col-md-offset-1 carousel-text">
<h1>Section Title 2</h1>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
<button>Link</button>
</div>
<div class="col-sm-5 col-xs-12 carousel-image">
<img alt="" class="img-responsive" src="http://www.placehold.it/458x376" />
</div>
</div>
</div>
</div>
<div class="item">
<div class="background-full background-two">
<div class="container carousel-container">
<div class="row">
<div class="col-sm-5 hidden-xs col-sm-offset-1 carousel-text">
<h1>Section Title 3</h1>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</p>
<p class="hidden-xs">Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do bijective tempor
incididunt ut azimuth angle et dolore magna aliqua. Ut enim
ad minim veniam, deemed nostrud nature ullamco contention
lab orphan tutti au ipsum equation intestate neer times aostrut nulloscent thermostatic suppressor tritium distance ekstru compositum ortusat comfortlessquez.</p>
<button>Link</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
/*owl-nav*/
.owl-prev {
position: absolute;
top: 40%;
left: 0;
}
.owl-next {
position: absolute;
top: 40%;
right: 0;
}
.fa {
font-size: 80px;
color: #fff;
}
@media (max-width:767px) {
.owl-nav {
display: none;
}
}
/*owl-dots*/
.owl-dots {
position: absolute;
bottom: 15px;
left: 50%;
margin-left: -27px;
}
.owl-dot {
background: #fff;
display: inline-block;
width: 10px;
height: 10px;
margin: 0 4px;
text-indent: -999em;
border-radius: 6px;
cursor: pointer;
-webkit-transition: background .5s, opacity .5s;
-moz-transition: background .5s, opacity .5s;
transition: background .5s, opacity .5s;
}
.owl-dot.active {
background: #333;
}
/*generic-carousel*/
.carousel-text, .carousel-image {
margin-top: 20px;
margin-bottom: 20px;
}
.background-full {
background-position: 50% 50%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: block;
width: 100%;
position: relative;
overflow: hidden;
height: 410px;
}
.background-one {
background-image: url(http://www.placehold.it/2560x410/ff6600);
}
.background-two {
background-image: url(http://www.placehold.it/2560x410/ff0066);
}
/*bootstap-resets*/
@media (min-width: 1200px) {
.carousel-container {
width: 970px;
}
}
Additional Comments:
- This project utilizes the Bootstrap framework.
- The spacing must remain consistent from 768px upwards.
- The current percentage positioning does not provide the desired alignment consistency.
- Avoidance of multiple media queries for positioning is preferred.
- Inclusion of a JavaScript solution is acceptable.
- All content within the central container should remain functional and clickable.
- Please disregard any layout issues present in the examples provided, as they serve as code snippets.
- Any further questions or clarifications can be addressed for better assistance.
Examples
We appreciate your time and support!