I am using owl-carousel to make a slider
for a website. I could easily make a slider using the following code :
<div id="owl-slider" class="owl-carousel">
<div> <img src="images/1.jpg" /> </div>
<div> <img src="images/2.jpg" /> </div>
<div> <img src="images/3.jpg" /> </div>
<div> <img src="images/4.jpg" /> </div>
</div>
<script type="text/javascript">
$("#owl-slider").owlCarousel({
items : 1,
autoPlay : true,
slideSpeed : 200,
stopOnHover : true,
navigation : false
})
$(document).ready(function() {
$("#owl-slider").owlCarousel();
});
</script>
I also want to place some text on the images in the slider. Unique text for each image. How can I do this with owl-carousel ?
An image macro is a piece of digital media featuring a picture, or artwork, with some form of text superimposed. The text frequently appears at the top and bottom of the image.
CSS position property is used to set the position of text over an image. This can be done by enclosing the image and text in an HTML “div”. Then make the position of div “relative” and that of text “absolute”.
Please check DEMO here
<div id="owl-slider" class="owl-carousel">
<div> <div class="textoverlay"><h1>Text 1</h1><p>Some text bla bla bla</p></div><img src="http://owlgraphic.com/owlcarousel/demos/assets/owl1.jpg" /></div>
<div> <h2>Text 2</h2><img src="http://owlgraphic.com/owlcarousel/demos/assets/owl6.jpg" /> </div>
<div><h2>Text 3</h2> <img src="http://owlgraphic.com/owlcarousel/demos/assets/owl8.jpg" /> </div>
<div> <h2>Text 4</h2><img src="http://owlgraphic.com/owlcarousel/demos/assets/owl3.jpg" /> </div>
CSS
.owl-carousel div h2, .owl-carousel div .textoverlay{
position:absolute;
color:#FFF;
font-size:12px;
display:block;
}
I check owl-carousel using DIV to define the thumb scroll, it mean you can easy to customize it. (Link removed due to SPAM)
Hope that help you :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With