javascript - having trouble position my arrows with unslider jQuery plugin -
i following documentation of unslider develop slidershow dots , arrows.
the dots have working want, arrows i´m having issues.
i´m not having sucess align left arrow left of slider , right arrow right of slide. did many tests nothing working.
do know how can unslider plugin?
what i´m trying: http://jsfiddle.net/jcak/rjqw8/
my html:
<section id="banner-container"> <div class="banner"> <ul> <li style="background-color:red; height:500px;">this slide.</li> <li style="background-color:green; height:500px;">this slide.</li> <li style="background-color:blue; height:500px;">this slide.</li> </ul> <a href="#" class="unslider-arrow prev"></a> <a href="#" class="unslider-arrow next"></a> </div> </section> my css:
#banner-container { width:100%; float:left; } .banner { position: relative; overflow: auto; width: 100%; } .banner li { list-style:none; background-repeat:no-repeat; background-size:cover; } .banner ul li { float: left; } .banner ul li img { width:100%; height:220px; } .banner .dots { margin-left:50%; bottom: 10px; left: 0; position: absolute; right: 0; display:none; } .banner:hover .dots { display:block; } .banner .dots li { border: 2px solid #fff; border-radius: 6px; cursor: pointer; display: inline-block; height: 10px; margin: 0 4px; opacity: .4; text-indent: -999em; -webkit-transition: background .5s, opacity .5s; -moz-transition: background .5s, opacity .5s; transition: background .5s, opacity .5s; width: 10px; } .banner .dots li.active { background: #fff; opacity: 1; } .arrows .prev { position: relative; top: -136px; } .arrows .next { position: absolute; right: 0; top: 109px; } my jquery:
$(function() { $('.banner').unslider({ speed: 2000, delay: 2000, fluid: true, dots: true, arrows: true, pause: true }); });
the problem facing css code not adressing < >s because have different classname. 2 options:
#1 - switch classnames in css file:
.unslider-arrow.prev {...} .unslider-arrow.next {...} #2 - switch classes in < >s ones you're using in css file:
<a href="#" class="arrow prev"></a> <a href="#" class="arrow next"></a> however, when using second option, have change relations in css to:
.arrow.prev {} .arrow.next {}
Comments
Post a Comment