javascript - Owl Carousel 2 Nav on Sides -


hi i'm using owl carousel version 2 , can't find example put navigation on sides of carousel right , left chevrons or arrows. how do it?

i did yesterday:)

firstly make sure nav turned on in config

http://www.owlcarousel.owlgraphic.com/docs/api-options.html

   $('#_samewidth_images').owlcarousel({       margin:10,       autowidth:false,       nav:true,       items:4,       navtext : ['<i class="fa fa-angle-left" aria-hidden="true"></i>','<i class="fa fa-angle-right" aria-hidden="true"></i>']   }) 

this inject controls dom, see

http://www.owlcarousel.owlgraphic.com/docs/api-classes.html

<div class="owl-carousel owl-theme owl-loaded">     <div class="owl-stage-outer">         <div class="owl-stage">             <div class="owl-item">...</div>             <div class="owl-item">...</div>             <div class="owl-item">...</div>         </div>     </div>     <div class="owl-controls">         <div class="owl-nav">             <div class="owl-prev">prev</div>             <div class="owl-next">next</div>         </div>         <div class="owl-dots">             <div class="owl-dot active"><span></span></div>             <div class="owl-dot"><span></span></div>             <div class="owl-dot"><span></span></div>         </div>     </div> </div> 

next use css position next , prev controls, used:

.owl-prev {     width: 15px;     height: 100px;     position: absolute;     top: 40%;     margin-left: -20px;     display: block!important;     border:0px solid black; }  .owl-next {     width: 15px;     height: 100px;     position: absolute;     top: 40%;     right: -25px;     display: block!important;     border:0px solid black; } .owl-prev i, .owl-next {transform : scale(1,6); color: #ccc;} 

for icons used font awesome use similar. note navtext in javascript code, put custom html. guess use image (or put in background of .owl-next , .owl-prev divs. note used transform make arrows higher.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -