@WalVix

Как на слайдере сделать кнопки по бокам?

Есть слайдер:

HTML:
<div id="w">
    <nav class="slidernav">
      <div id="navbtns" class="clearfix">
        <a href="#" class="previous">&laquo;</a>
        <a href="#" class="next">&raquo;</a>
      </div>
    </nav>
    
    <div class="crsl-items" data-navigation="navbtns">
      <div class="crsl-wrap">
        <div class="crsl-item">
          <div class="thumbnail">
            <img src="" alt="nyc subway">
          </div>
          <h3><a href=""></a></h3>
          <p></p>
          <p class="readmore"><a href="">Узнайте больше &raquo;</a></p>
        </div><!-- post #1 -->
        
        <div class="crsl-item">
          <div class="thumbnail">
            <img src="" alt="danny antonucci">
          </div>
          <h3><a href=""></a></h3>
          <p></p>
          <p class="readmore"><a href="">Узнайте больше &raquo;</a></p>
        </div><!-- post #2 -->


CSS:
table { border-collapse: collapse; border-spacing: 0; }

/** page structure **/
#w {
  display: block;
  max-width: 800px;
  min-width: 300px;
  margin: 0 auto;
  padding: 40px 5px 100px 5px;
}
/** posts slider widget **/
.crsl-items {
  display: block;
}
.crsl-item {
  background: #fff;
}
.crsl-item .thumbnail {
  display: block;
  position: relative;
  margin-bottom: 10px;
  cursor: pointer;
}
.crsl-item .thumbnail img { 
  display: block;
  -webkit-transition: all 0.3s linear;
  -moz-transition: all 0.3s linear;
  transition: all 0.3s linear;
}
.crsl-item .thumbnail:hover img {
  opacity: 0.8; 
}
.crsl-item h3 {
  font-family: 'Oswald', 'Trebuchet MS', Helvetica, sans-serif;
  font-size: 1.95em;
  line-height: 1.25em;
    width: 200px;
    text-align: center;
    margin: auto;
}
.crsl-item h3 a {
  text-decoration: none;
  color: #333;
}
.crsl-item h3 a:hover {
  text-decoration: underline;
}
.crsl-item .postdate {
  display: block;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 6px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  font-size: 1.2em;
  font-weight: bold;
  background: #000;
}
.crsl-item p {
  font-size: 1.5em;
  line-height: 1.3em;
  margin-bottom: 5px;
    margin-top: -20px;
    text-align: center;
    font-family: 'Oswald', 'Trebuchet MS', Helvetica, sans-serif;
}
.crsl-item p.readmore a {
  display: block;
  margin: auto;
  color: #000;
  padding: 8px 15px;
  text-decoration: none;
  font-weight: bold;
  -webkit-border-radius: 3px;
  -moz-border-radius: 4px;
  border-radius: 4px;
}
.crsl-item p.readmore a:hover {
  background: #000;
  color: #fff;
  transform: scale(1.1);
  transition: all 0.8s ease;
}
/** posts slider nav **/
.slidernav {
  display: block;
  text-align: center;
  margin-bottom: 5px;
}
.slidernav a {
  display: inline-block;
  padding: 20px 10px;
  margin-right: 8px;
  font-size: 3em;
  background: #fff;
  color: #666;
  text-decoration: none;
  -webkit-box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  -moz-box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}
.slidernav a:active {
  -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  -moz-box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}
.slidernav a:hover {
    background: #000;
    color: #fff;
    transition: all 0.5s ease;
    border: 1px solid silver;
}
/** media queries **/
@media screen and (max-width: 660px) {
  h1 { font-size: 2.4em; line-height: 1.2em; }
  
  .crsl-item h3 { font-size: 1.65em; }
}
/** clearfix **/
.clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
.clearfix { display: inline-block; }
 
html[xmlns] .clearfix { display: block; }
* html .clearfix { height: 1%; }


JS:
<script type="text/javascript">
$(function(){
  $('.crsl-items').carousel({
    visible: 3,
    itemMinWidth: 180,
    itemEqualHeight: 370,
    itemMargin: 35,
  });
  
  $("a[href=#]").on('click', function(e) {
    e.preventDefault();
  });
});
</script>


Сделать нужно, чтобы кнопки сверху переместились по бокам
5f2d6fe938990270097651.png

P.S. Сам не могу догадаться
  • Вопрос задан
  • 883 просмотра
Пригласить эксперта
Ответы на вопрос 1
SpiderPigAndCat
@SpiderPigAndCat
занимаюсь салообразованием
на контейнер с кнопками position relative
на кнопки position absolute и каждую кнопкуу ровняешь. right:0 left :0
а вообще выложи код на кодепен и дай ссылку сюда
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы